diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp index 255437e3a2..081c09f91c 100644 --- a/src/gpu/SkGrPixelRef.cpp +++ b/src/gpu/SkGrPixelRef.cpp @@ -167,7 +167,10 @@ bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { height = fSurface->height(); } dst->setConfig(SkBitmap::kARGB_8888_Config, width, height); - dst->allocPixels(); + if (!dst->allocPixels()) { + SkDebugf("SkGrPixelRef::onReadPixels failed to alloc bitmap for result!\n"); + return false; + } SkAutoLockPixels al(*dst); void* buffer = dst->getPixels(); return fSurface->readPixels(left, top, width, height,