aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapScaler.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-10-01 11:21:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-01 11:21:57 -0700
commitd1d4460547bcd76db7142cf9b6370dc952d459fc (patch)
treec3bb07a479e8157242473aedeb02c7df77586b8b /src/core/SkBitmapScaler.cpp
parent3d8c33cd835054affab43ac8c96f349147d2e776 (diff)
add hard-coded limit for tmp allocations when HQ image scaling
Diffstat (limited to 'src/core/SkBitmapScaler.cpp')
-rw-r--r--src/core/SkBitmapScaler.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp
index 962fdce375..965955a2dc 100644
--- a/src/core/SkBitmapScaler.cpp
+++ b/src/core/SkBitmapScaler.cpp
@@ -245,11 +245,13 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr, const SkPixmap& source, ResizeM
return false;
}
- BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()),
- !source.isOpaque(), filter.xFilter(), filter.yFilter(),
- static_cast<int>(result.rowBytes()),
- static_cast<unsigned char*>(result.getPixels()),
- convolveProcs, true);
+ if (!BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()),
+ !source.isOpaque(), filter.xFilter(), filter.yFilter(),
+ static_cast<int>(result.rowBytes()),
+ static_cast<unsigned char*>(result.getPixels()),
+ convolveProcs, true)) {
+ return false;
+ }
*resultPtr = result;
resultPtr->lockPixels();