mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1217465 - Fill in missing pixels caused by truncated BMP files. r=seth.
This fixes failures for image/test/reftest/bmp/bmpsuite/b/{badrle.bmp,shortfile.bmp} with the Skia back-end.
This commit is contained in:
parent
09b8b80cbe
commit
357de81606
@ -240,6 +240,17 @@ nsBMPDecoder::FinishInternal()
|
||||
// Send notifications if appropriate.
|
||||
if (!IsMetadataDecode() && HasSize()) {
|
||||
|
||||
// If it was truncated, fill in the missing pixels as black.
|
||||
while (mCurrentRow > 0) {
|
||||
uint32_t* dst = RowBuffer();
|
||||
while (mCurrentPos < mH.mWidth) {
|
||||
SetPixel(dst, 0, 0, 0);
|
||||
mCurrentPos++;
|
||||
}
|
||||
mCurrentPos = 0;
|
||||
FinishRow();
|
||||
}
|
||||
|
||||
// Invalidate.
|
||||
nsIntRect r(0, 0, mH.mWidth, AbsoluteHeight());
|
||||
PostInvalidation(r);
|
||||
|
@ -230,8 +230,9 @@ private:
|
||||
|
||||
int32_t mCurrentRow; // Index of the row of the image that's currently
|
||||
// being decoded: [height,1].
|
||||
int32_t mCurrentPos; // Index into the current line; only used when
|
||||
// doing RLE decoding.
|
||||
int32_t mCurrentPos; // Index into the current line. Used when
|
||||
// doing RLE decoding and when filling in pixels
|
||||
// for truncated files.
|
||||
|
||||
// Only used in RLE_ABSOLUTE state: the number of pixels to read.
|
||||
uint32_t mAbsoluteModeNumPixels;
|
||||
|
Loading…
Reference in New Issue
Block a user