From: msarett Date: Wed, 18 Mar 2015 19:59:46 +0000 (-0700) Subject: Do not create empty color table if it does not exist X-Git-Tag: submit/tizen/20180928.044319~3159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f21ef2776b4a40a4e5dea677d93069698c7115ad;p=platform%2Fupstream%2FlibSkiaSharp.git Do not create empty color table if it does not exist BUG=skia: Review URL: https://codereview.chromium.org/1019543003 --- 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; }