Index: src/images/SkImageDecoder_libjpeg.cpp |
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp |
index 219dad6db220cd67dce4daea57ce2f3bc1a71381..0d02a658f29626acef03df8b523de9bdce9f8fee 100644 |
--- a/src/images/SkImageDecoder_libjpeg.cpp |
+++ b/src/images/SkImageDecoder_libjpeg.cpp |
@@ -496,8 +496,8 @@ SkImageDecoder::Result SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* |
return return_failure(cinfo, *bm, "sampler.begin"); |
} |
- SkAutoMalloc srcStorage(cinfo.output_width * srcBytesPerPixel); |
- uint8_t* srcRow = (uint8_t*)srcStorage.get(); |
+ SkAutoTMalloc<uint8_t> srcStorage(cinfo.output_width * srcBytesPerPixel); |
+ uint8_t* srcRow = srcStorage.get(); |
// Possibly skip initial rows [sampler.srcY0] |
if (!skip_src_rows(&cinfo, srcRow, sampler.srcY0())) { |
@@ -931,7 +931,7 @@ protected: |
skjpeg_destination_mgr sk_wstream(stream); |
// allocate these before set call setjmp |
- SkAutoMalloc oneRow; |
+ SkAutoTMalloc<uint8_t> oneRow; |
cinfo.err = jpeg_std_error(&sk_err); |
sk_err.error_exit = skjpeg_error_exit; |
@@ -966,7 +966,7 @@ protected: |
jpeg_start_compress(&cinfo, TRUE); |
const int width = bm.width(); |
- uint8_t* oneRowP = (uint8_t*)oneRow.reset(width * 3); |
+ uint8_t* oneRowP = oneRow.reset(width * 3); |
const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : nullptr; |
const void* srcRow = bm.getPixels(); |