Fixed clusterfuzz issue
authorsugoi <sugoi@chromium.org>
Wed, 28 Jan 2015 21:15:32 +0000 (13:15 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 28 Jan 2015 21:15:32 +0000 (13:15 -0800)
BUG=448423

Review URL: https://codereview.chromium.org/881423002

src/core/SkBitmap.cpp

index c962aea21a10fc3dd4e31705a9c334dcf83e450d..e77bbbd4e5e461cd6bd1030584ab1efd824b0ea8 100644 (file)
@@ -1232,6 +1232,9 @@ bool SkBitmap::ReadRawPixels(SkReadBuffer* buffer, SkBitmap* bitmap) {
 
     SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewWithData(info, info.minRowBytes(),
                                                               ctable.get(), data.get()));
+    if (!pr.get()) {
+        return false;
+    }
     bitmap->setInfo(pr->info());
     bitmap->setPixelRef(pr, 0, 0);
     return true;