Backed out changeset 40784ea31188 (bug 651482) for Reftest failures in bmp-corrupted/wrapper.html?invalid-compression-BITFIELDS.bmp. CLOSED TREE

This commit is contained in:
Dorel Luca 2020-05-22 12:21:32 +03:00
Родитель dd545d38b7
Коммит 6c1dbf7154
12 изменённых файлов: 10 добавлений и 23 удалений

Просмотреть файл

@ -20,8 +20,6 @@ struct InfoHeaderLength {
enum {
WIN_V2 = 12,
WIN_V3 = 40,
WIN_V3_NT = 52,
WIN_V3_NT_ALPHA = 56,
WIN_V4 = 108,
WIN_V5 = 124,

Просмотреть файл

@ -36,7 +36,7 @@
//
// WinBMPv3. This is the most widely used version.
// - It changed the info header to 40 bytes by taking the WinBMPv2 info
// header, enlarging its width and height fields, and adding more fields
// header, enlargening its width and height fields, and adding more fields
// including: a compression type (|mCompression|) and number of colors
// (|mNumColors|).
// - The semi-optional color table is now 4 bytes per value (BGR0), and its
@ -48,11 +48,7 @@
// - It did not change the info header layout from WinBMPv3.
// - |mBpp| can now be 16 or 32, in which case |mCompression| can be RGB or the
// new BITFIELDS value; in the latter case an additional 12 bytes of color
// bitfields follow the info header (52 bytes total).
//
// WinBMPv3-NT-Alpha. A variant of WinBMPv3-NT with support for alpha channels.
// Adds an additional 4 bytes in in the info header (now 56 bytes total), and
// supports an alpha channel in the BITFIELDS sections.
// bitfields follow the info header.
//
// WinBMPv4.
// - It extended the info header to 108 bytes, including the 12 bytes of color
@ -498,8 +494,6 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadInfoHeaderSize(
bool bihSizeOk = mH.mBIHSize == InfoHeaderLength::WIN_V2 ||
mH.mBIHSize == InfoHeaderLength::WIN_V3 ||
mH.mBIHSize == InfoHeaderLength::WIN_V3_NT ||
mH.mBIHSize == InfoHeaderLength::WIN_V3_NT_ALPHA ||
mH.mBIHSize == InfoHeaderLength::WIN_V4 ||
mH.mBIHSize == InfoHeaderLength::WIN_V5 ||
(mH.mBIHSize >= InfoHeaderLength::OS2_V2_MIN &&
@ -617,8 +611,6 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadInfoHeaderRest(
// For BITFIELDS compression we require an exact match for one of the
// WinBMP BIH sizes; this clearly isn't an OS2 BMP.
(mH.mBIHSize == InfoHeaderLength::WIN_V3 ||
mH.mBIHSize == InfoHeaderLength::WIN_V3_NT ||
mH.mBIHSize == InfoHeaderLength::WIN_V3_NT_ALPHA ||
mH.mBIHSize == InfoHeaderLength::WIN_V4 ||
mH.mBIHSize == InfoHeaderLength::WIN_V5) &&
(mH.mBpp == 16 || mH.mBpp == 32));
@ -641,7 +633,7 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadInfoHeaderRest(
size_t bitFieldsLengthStillToRead = 0;
if (mH.mCompression == Compression::BITFIELDS) {
// Need to read bitfields.
if (mH.mBIHSize >= InfoHeaderLength::WIN_V3_NT) {
if (mH.mBIHSize >= InfoHeaderLength::WIN_V4) {
// Bitfields are present in the info header, so we can read them
// immediately.
mBitFields.ReadFromHeader(aData + 36, /* aReadAlpha = */ true);
@ -1047,7 +1039,8 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadPixelRow(
break;
case 32:
if (mH.mCompression == Compression::RGB && mIsWithinICO) {
if (mH.mCompression == Compression::RGB && mIsWithinICO &&
mH.mBpp == 32) {
// This is a special case only used for 32bpp WinBMPv3-ICO files, which
// could be in either 0RGB or ARGB format. We start by assuming it's
// an 0RGB image. If we hit a non-zero alpha value, then we know it's

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 100 B

Двоичные данные
image/test/reftest/bmp/bmp-24bpp/24bpp-rgb.bmp

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 174 B

Просмотреть файл

@ -19,4 +19,3 @@
== bmp-not-square-24bpp.bmp bmp-not-square-24bpp.png
== os2bmp-size-32x32-24bpp.bmp bmp-size-32x32-24bpp.png
== top-to-bottom-16x16-24bpp.bmp bmp-size-16x16-24bpp.png
== 24bpp-rgb.bmp 24bpp-rgb-ref.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 100 B

Двоичные данные
image/test/reftest/bmp/bmp-32bpp/32bpp-rgb.bmp

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 214 B

Просмотреть файл

@ -1,4 +0,0 @@
# BMP 32BPP tests
# Images of various odd size info header sizes
== 32bpp-rgb.bmp 32bpp-rgb-ref.png

Просмотреть файл

@ -183,8 +183,9 @@ fuzzy(10-10,6590-6597) == rgb24prof2.bmp rgb24.png
# BMP: bihsize=52, 127 x 64, bpp=32, compression=3, colors=0
# "Similar to g/rgb32bf.bmp, but with a 52-byte “BITMAPV2INFOHEADER”. This is
# an uncommon version of BMP."
== rgb32h52.bmp rgb32h52.png
# an uncommon version of BMP, and I cant confirm that this file is correct."
# [We reject it. Chromium accepts it.]
== wrapper.html?rgb32h52.bmp about:blank
# BMP: bihsize=124, 127 x 64, bpp=32, compression=3, colors=0
# "Color channels are the same size and order as rgb32bfdef.bmp, but they use
@ -245,5 +246,6 @@ fuzzy(0-1,0-1554) == rgba32-61754.bmp rgba32-61754.png
# BMP: bihsize=56, 127 x 64, bpp=32, compression=3, colors=0
# "Similar to q/rgba32.bmp, but with a 56-byte “BITMAPV3INFOHEADER”. This is an
# uncommon version of BMP, and I cant confirm that this file is correct."
== rgba32h56.bmp rgba32h56.png
# [We reject it. Chromium accepts it.]
== wrapper.html?rgba32h56.bmp about:blank

Двоичные данные
image/test/reftest/bmp/bmpsuite/q/rgb32h52.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
image/test/reftest/bmp/bmpsuite/q/rgba32h56.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Просмотреть файл

@ -4,7 +4,6 @@ include bmp-1bpp/reftest.list
include bmp-4bpp/reftest.list
include bmp-8bpp/reftest.list
include bmp-24bpp/reftest.list
include bmp-32bpp/reftest.list
include bmp-corrupted/reftest.list
include bmpsuite/reftest.list