diff options
author | 2015-10-01 11:21:57 -0700 | |
---|---|---|
committer | 2015-10-01 11:21:57 -0700 | |
commit | d1d4460547bcd76db7142cf9b6370dc952d459fc (patch) | |
tree | c3bb07a479e8157242473aedeb02c7df77586b8b /src/core/SkBitmapScaler.cpp | |
parent | 3d8c33cd835054affab43ac8c96f349147d2e776 (diff) |
add hard-coded limit for tmp allocations when HQ image scaling
BUG=528628
Review URL: https://codereview.chromium.org/1368393003
Diffstat (limited to 'src/core/SkBitmapScaler.cpp')
-rw-r--r-- | src/core/SkBitmapScaler.cpp | 12 |
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(); |