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; |
} |
} |