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

Unified Diff: src/images/SkImageDecoder_libpng.cpp

Issue 510423005: make allocPixels throw on failure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: can't use (void) to suppress the "must check return result" Created 6 years, 3 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
Index: src/images/SkImageDecoder_libpng.cpp
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index 01b7c69c257522586987487b51443787a2b40b7a..b69f87996c76c5e5a96fa7eac063d62d1f4aab02 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -823,7 +823,7 @@ bool SkPNGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
return false;
}
} else {
- if (!decodedBitmap.allocPixels(NULL, needColorTable ? colorTable : NULL)) {
+ if (!decodedBitmap.tryAllocPixels(NULL, needColorTable ? colorTable : NULL)) {
return false;
}
}

Powered by Google App Engine
This is Rietveld 408576698