Bug 1249550 (part 1) - Flip BMPs with negative height when downscaling. r=tn.

This commit is contained in:
Nicholas Nethercote 2016-02-22 13:38:58 +11:00
parent 18cead6ef6
commit 0494c4820e

View File

@ -682,10 +682,11 @@ nsBMPDecoder::ReadBitfields(const char* aData, size_t aLength)
if (mDownscaler) {
// BMPs store their rows in reverse order, so the downscaler needs to
// reverse them again when writing its output.
// reverse them again when writing its output. Unless the height is
// negative!
rv = mDownscaler->BeginFrame(GetSize(), Nothing(),
mImageData, mMayHaveTransparency,
/* aFlipVertically = */ true);
/* aFlipVertically = */ mH.mHeight >= 0);
if (NS_FAILED(rv)) {
return Transition::TerminateFailure();
}