Index: src/codec/SkJpegCodec.cpp |
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp |
index 6ea13b7639dd560d9e06d5b490f26be267616e46..7db772da6386ad9a3b0002d5334598a625fd6fa2 100644 |
--- a/src/codec/SkJpegCodec.cpp |
+++ b/src/codec/SkJpegCodec.cpp |
@@ -350,12 +350,12 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& |
fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, options)); |
fStorage.reset(get_row_bytes(fDecoderMgr->dinfo())); |
- fSrcRow = static_cast<uint8_t*>(fStorage.get()); |
+ fSrcRow = fStorage.get(); |
} |
SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) { |
if (!createIfNecessary || fSwizzler) { |
- SkASSERT(!fSwizzler || (fSrcRow && static_cast<uint8_t*>(fStorage.get()) == fSrcRow)); |
+ SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow)); |
return fSwizzler; |
} |
@@ -433,8 +433,8 @@ int SkJpegCodec::onGetScanlines(void* dst, int count, size_t rowBytes) { |
#ifndef TURBO_HAS_SKIP |
// TODO (msarett): Avoid reallocating the memory buffer on each call to skip. |
static uint32_t jpeg_skip_scanlines(jpeg_decompress_struct* dinfo, int count) { |
- SkAutoMalloc storage(get_row_bytes(dinfo)); |
- uint8_t* storagePtr = static_cast<uint8_t*>(storage.get()); |
+ SkAutoTMalloc<uint8_t> storage(get_row_bytes(dinfo)); |
+ uint8_t* storagePtr = storage.get(); |
for (int y = 0; y < count; y++) { |
if (1 != jpeg_read_scanlines(dinfo, &storagePtr, 1)) { |
return y; |