From cd3b15ca6364a04b0eeeb4f89c7daa8aefe854c8 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 4 Dec 2013 17:06:49 +0000 Subject: Fixed bad bitmap size crashes There were 2 issues : 1 ) If the size of an SkBitmap's underlying SkPixelRef's alocated memory is too small to fit the bitmap, then the deserialization will now check this and set an error appropriately. 2 ) If a device fails to allocate its pixels, the device will be deleted and NULL will be returned to avoid attempting to draw on a bad device. BUG= R=senorblanco@chromium.org, reed@google.com, sugoi@google.com, halcanary@google.com, mtklein@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/92793002 git-svn-id: http://skia.googlecode.com/svn/trunk@12484 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkPixelRef.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/SkPixelRef.cpp') diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp index 972474ccc3..068513bb1c 100644 --- a/src/core/SkPixelRef.cpp +++ b/src/core/SkPixelRef.cpp @@ -247,6 +247,10 @@ SkData* SkPixelRef::onRefEncodedData() { return NULL; } +size_t SkPixelRef::getAllocatedSizeInBytes() const { + return 0; +} + /////////////////////////////////////////////////////////////////////////////// #ifdef SK_BUILD_FOR_ANDROID -- cgit v1.2.3