Index: src/codec/SkSampledCodec.cpp |
diff --git a/src/codec/SkSampledCodec.cpp b/src/codec/SkSampledCodec.cpp |
index 52e5648742ecea5a2c82f32f198dbd365a8f17be..38859ad6be3b41e8edbacd747792f3fa66dde976 100644 |
--- a/src/codec/SkSampledCodec.cpp |
+++ b/src/codec/SkSampledCodec.cpp |
@@ -9,6 +9,7 @@ |
#include "SkCodecPriv.h" |
#include "SkMath.h" |
#include "SkSampledCodec.h" |
+#include "SkTemplates.h" |
SkSampledCodec::SkSampledCodec(SkCodec* codec) |
: INHERITED(codec->getInfo()) |
@@ -267,8 +268,8 @@ SkCodec::Result SkSampledCodec::sampledDecode(const SkImageInfo& info, void* pix |
} |
case SkCodec::kNone_SkScanlineOrder: { |
const int linesNeeded = subsetHeight - samplingOffsetY; |
- SkAutoMalloc storage(linesNeeded * rowBytes); |
- uint8_t* storagePtr = static_cast<uint8_t*>(storage.get()); |
+ SkAutoTMalloc<uint8_t> storage(linesNeeded * rowBytes); |
+ uint8_t* storagePtr = storage.get(); |
if (!fCodec->skipScanlines(startY)) { |
fCodec->fillIncompleteImage(info, pixels, rowBytes, options.fZeroInitialized, |