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

Unified Diff: skia/effects/SkLayerRasterizer.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 | « skia/effects/SkKernel33MaskFilter.cpp ('k') | skia/include/SkMask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/effects/SkLayerRasterizer.cpp
===================================================================
--- skia/effects/SkLayerRasterizer.cpp (revision 14480)
+++ skia/effects/SkLayerRasterizer.cpp (working copy)
@@ -108,8 +108,12 @@
{
mask->fFormat = SkMask::kA8_Format;
mask->fRowBytes = SkToU16(mask->fBounds.width());
- mask->fImage = SkMask::AllocImage(mask->computeImageSize());
- memset(mask->fImage, 0, mask->computeImageSize());
+ size_t size = mask->computeImageSize();
+ if (0 == size) {
+ return false; // too big to allocate, abort
+ }
+ mask->fImage = SkMask::AllocImage(size);
+ memset(mask->fImage, 0, size);
}
if (SkMask::kJustComputeBounds_CreateMode != mode)
« no previous file with comments | « skia/effects/SkKernel33MaskFilter.cpp ('k') | skia/include/SkMask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698