Do not create empty color table if it does not exist

BUG=skia:

Review URL: https://codereview.chromium.org/1019543003
This commit is contained in:
msarett 2015-03-18 12:59:46 -07:00 committed by Commit bot
parent 422677ceab
commit f21ef2776b

View File

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