Index: src/codec/SkBmpStandardCodec.cpp |
diff --git a/src/codec/SkBmpStandardCodec.cpp b/src/codec/SkBmpStandardCodec.cpp |
index 66a8c9a12a12c4d1af73c3ebd7d83856a55b9ac8..47b10701d332156a63ece8f08f852f3d09dc443f 100644 |
--- a/src/codec/SkBmpStandardCodec.cpp |
+++ b/src/codec/SkBmpStandardCodec.cpp |
@@ -25,8 +25,7 @@ SkBmpStandardCodec::SkBmpStandardCodec(const SkImageInfo& info, SkStream* stream |
, fBytesPerColor(bytesPerColor) |
, fOffset(offset) |
, fSwizzler(nullptr) |
- , fSrcRowBytes(SkAlign4(compute_row_bytes(this->getInfo().width(), this->bitsPerPixel()))) |
- , fSrcBuffer(new uint8_t [fSrcRowBytes]) |
+ , fSrcBuffer(new uint8_t [this->srcRowBytes()]) |
, fIsOpaque(isOpaque) |
, fInIco(inIco) |
, fAndMaskRowBytes(fInIco ? SkAlign4(compute_row_bytes(this->getInfo().width(), 1)) : 0) |
@@ -225,7 +224,7 @@ int SkBmpStandardCodec::decodeRows(const SkImageInfo& dstInfo, void* dst, size_t |
const int height = dstInfo.height(); |
for (int y = 0; y < height; y++) { |
// Read a row of the input |
- if (this->stream()->read(fSrcBuffer.get(), fSrcRowBytes) != fSrcRowBytes) { |
+ if (this->stream()->read(fSrcBuffer.get(), this->srcRowBytes()) != this->srcRowBytes()) { |
SkCodecPrintf("Warning: incomplete input stream.\n"); |
return y; |
} |
@@ -262,7 +261,7 @@ int SkBmpStandardCodec::decodeRows(const SkImageInfo& dstInfo, void* dst, size_t |
// Calculate how many bytes we must skip to reach the AND mask. |
const int remainingScanlines = this->getInfo().height() - startScanline - height; |
- const size_t bytesToSkip = remainingScanlines * fSrcRowBytes + |
+ const size_t bytesToSkip = remainingScanlines * this->srcRowBytes() + |
startScanline * fAndMaskRowBytes; |
const size_t subStreamStartPosition = currPosition + bytesToSkip; |
if (subStreamStartPosition >= length) { |