Index: bench/subset/SubsetZoomBench.cpp |
diff --git a/bench/subset/SubsetZoomBench.cpp b/bench/subset/SubsetZoomBench.cpp |
index 3ce193b6ea8da33e7083da2c1e3386ea58ac2114..896da89a150a53485e1f5eb109de0398f5c14038 100644 |
--- a/bench/subset/SubsetZoomBench.cpp |
+++ b/bench/subset/SubsetZoomBench.cpp |
@@ -55,7 +55,7 @@ bool SubsetZoomBench::isSuitableFor(Backend backend) { |
void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) { |
// When the color type is kIndex8, we will need to store the color table. If it is |
// used, it will be initialized by the codec. |
- int colorCount; |
+ int colorCount = 0; |
SkPMColor colors[256]; |
if (fUseCodec) { |
for (int count = 0; count < n; count++) { |
@@ -77,7 +77,8 @@ void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) { |
// Note that if we subsetted and scaled in a single step, we could use the |
// same bitmap - as is often done in actual use cases. |
SkBitmap bitmap; |
- bitmap.allocPixels(info.makeWH(subsetWidth, subsetHeight)); |
+ bitmap.allocPixels(info.makeWH(subsetWidth, subsetHeight), NULL, |
+ SkNEW_ARGS(SkColorTable, (colors, colorCount))); |
uint32_t bpp = info.bytesPerPixel(); |
scanlineDecoder->skipScanlines(subsetStartY); |