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

Unified Diff: src/images/SkImageDecoder.cpp

Issue 1004313002: check for null-pixelref (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder.cpp
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 89a47054b2f05ea7369a7c1a3951daffff9fda6a..5b3cf325455f9fe3791893f65b4bf1bebdd52ef7 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -222,7 +222,9 @@ bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm, SkColorType pre
SkAutoTDelete<SkStreamRewindable> stream(SkStream::NewFromFile(file));
if (stream.get()) {
if (SkImageDecoder::DecodeStream(stream, bm, pref, mode, format)) {
- bm->pixelRef()->setURI(file);
+ if (SkPixelRef* pr = bm->pixelRef()) {
+ pr->setURI(file);
+ }
return true;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698