Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: skia/effects/SkBlurMask.cpp

Issue 93093: Implement canvas's globalCompositeOperation lighter properly.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | skia/effects/SkEmbossMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/effects/SkBlurMask.cpp
===================================================================
--- skia/effects/SkBlurMask.cpp (revision 14480)
+++ skia/effects/SkBlurMask.cpp (working copy)
@@ -234,10 +234,15 @@
if (src.fImage)
{
+ size_t dstSize = dst->computeImageSize();
+ if (0 == dstSize) {
+ return false; // too big to allocate, abort
+ }
+
int sw = src.fBounds.width();
int sh = src.fBounds.height();
const uint8_t* sp = src.fImage;
- uint8_t* dp = SkMask::AllocImage(dst->computeImageSize());
+ uint8_t* dp = SkMask::AllocImage(dstSize);
SkAutoTCallVProc<uint8_t, SkMask_FreeImage> autoCall(dp);
@@ -258,7 +263,11 @@
// the blur into it (applying the src)
if (style == kInner_Style)
{
- dst->fImage = SkMask::AllocImage(src.computeImageSize());
+ size_t srcSize = src.computeImageSize();
+ if (0 == srcSize) {
+ return false; // too big to allocate, abort
+ }
+ dst->fImage = SkMask::AllocImage(srcSize);
merge_src_with_blur(dst->fImage, sp, sw, sh,
dp + rx + ry*dst->fBounds.width(),
dst->fBounds.width());
« no previous file with comments | « no previous file | skia/effects/SkEmbossMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698