aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-16 07:28:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-16 07:28:13 -0700
commitdedc2d8e8dc635ff43e6b314b280e3efe85ce8a7 (patch)
tree7e6a9bf9c46c378ce5c6671146e34e73784823aa /src/images
parent3a224666df92e7568c8fcf1cc28baa20360ca4aa (diff)
check for null-pixelref
Diffstat (limited to 'src/images')
-rw-r--r--src/images/SkImageDecoder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 89a47054b2..5b3cf32545 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;
}
}