aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMSrcSink.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-03-25 05:27:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-25 05:27:48 -0700
commit9bde918754bc292469d801f156f3b626eb3db780 (patch)
treec59c3026e31c8712a415c5adba11dfd391329506 /dm/DMSrcSink.cpp
parent6adf849f4eedd19591ce35129a846209e7e6393b (diff)
Enabling ico decoding with use of png and bmp decoders
BUG=skia:3257 NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1011343003
Diffstat (limited to 'dm/DMSrcSink.cpp')
-rw-r--r--dm/DMSrcSink.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 638f670834..fe31d61ef0 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -88,7 +88,11 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkISize CodecSrc::size() const {
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
- return codec->getInfo().dimensions();
+ if (NULL != codec) {
+ return codec->getInfo().dimensions();
+ } else {
+ return SkISize::Make(0, 0);
+ }
}
Name CodecSrc::name() const {