aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-03-18 12:59:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-18 12:59:46 -0700
commitf21ef2776b4a40a4e5dea677d93069698c7115ad (patch)
tree0a258745fcbc1fd9012a230a7cba9d106732ae50 /src
parent422677ceab3908060917adf4181aaebb48bbaf41 (diff)
Do not create empty color table if it does not exist
Diffstat (limited to 'src')
-rw-r--r--src/codec/SkCodec_libbmp.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codec/SkCodec_libbmp.cpp b/src/codec/SkCodec_libbmp.cpp
index 62cda95733..e9551cbb6f 100644
--- a/src/codec/SkCodec_libbmp.cpp
+++ b/src/codec/SkCodec_libbmp.cpp
@@ -570,7 +570,9 @@ SkCodec::Result SkBmpCodec::onGetPixels(const SkImageInfo& dstInfo,
}
// Set the color table and return true on success
- fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors)));
+ if (maxColors > 0) {
+ fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors)));
+ }
return true;
}