diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc index f4b8d99bb1e67b..d2ce4afa3a733f 100644 --- a/skia/ext/image_operations.cc +++ b/skia/ext/image_operations.cc @@ -375,8 +375,7 @@ SkBitmap ImageOperations::Resize(const SkPixmap& source, SkBitmap result; result.setInfo( source.info().makeWH(dest_subset.width(), dest_subset.height())); - result.allocPixels(allocator); - if (!result.readyToDraw()) + if (!result.tryAllocPixels(allocator) || !result.readyToDraw()) return SkBitmap(); BGRAConvolve2D(source_subset, static_cast(source.rowBytes()),