зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1249578 (Part 2) - Add a test that decoding ICOs with a size mismatch between the BIH header and the ICO directory entry fails. r=njn
This commit is contained in:
Родитель
1d5c203221
Коммит
82666db699
|
@ -485,6 +485,22 @@ ImageTestCase CorruptTestCase()
|
|||
TEST_CASE_HAS_ERROR);
|
||||
}
|
||||
|
||||
ImageTestCase CorruptICOWithBadBMPWidthTestCase()
|
||||
{
|
||||
// This ICO contains a BMP icon which has a width that doesn't match the size
|
||||
// listed in the corresponding ICO directory entry.
|
||||
return ImageTestCase("corrupt-with-bad-bmp-width.ico", "image/x-icon",
|
||||
IntSize(100, 100), TEST_CASE_HAS_ERROR);
|
||||
}
|
||||
|
||||
ImageTestCase CorruptICOWithBadBMPHeightTestCase()
|
||||
{
|
||||
// This ICO contains a BMP icon which has a height that doesn't match the size
|
||||
// listed in the corresponding ICO directory entry.
|
||||
return ImageTestCase("corrupt-with-bad-bmp-height.ico", "image/x-icon",
|
||||
IntSize(100, 100), TEST_CASE_HAS_ERROR);
|
||||
}
|
||||
|
||||
ImageTestCase TransparentPNGTestCase()
|
||||
{
|
||||
return ImageTestCase("transparent.png", "image/png", IntSize(32, 32),
|
||||
|
|
|
@ -327,6 +327,8 @@ ImageTestCase GreenFirstFrameAnimatedGIFTestCase();
|
|||
ImageTestCase GreenFirstFrameAnimatedPNGTestCase();
|
||||
|
||||
ImageTestCase CorruptTestCase();
|
||||
ImageTestCase CorruptICOWithBadBMPWidthTestCase();
|
||||
ImageTestCase CorruptICOWithBadBMPHeightTestCase();
|
||||
|
||||
ImageTestCase TransparentPNGTestCase();
|
||||
ImageTestCase TransparentGIFTestCase();
|
||||
|
|
|
@ -350,6 +350,26 @@ TEST(ImageDecoders, CorruptMultiChunk)
|
|||
CheckDecoderMultiChunk(CorruptTestCase());
|
||||
}
|
||||
|
||||
TEST(ImageDecoders, CorruptICOWithBadBMPWidthSingleChunk)
|
||||
{
|
||||
CheckDecoderSingleChunk(CorruptICOWithBadBMPWidthTestCase());
|
||||
}
|
||||
|
||||
TEST(ImageDecoders, CorruptICOWithBadBMPWidthMultiChunk)
|
||||
{
|
||||
CheckDecoderMultiChunk(CorruptICOWithBadBMPWidthTestCase());
|
||||
}
|
||||
|
||||
TEST(ImageDecoders, CorruptICOWithBadBMPHeightSingleChunk)
|
||||
{
|
||||
CheckDecoderSingleChunk(CorruptICOWithBadBMPHeightTestCase());
|
||||
}
|
||||
|
||||
TEST(ImageDecoders, CorruptICOWithBadBMPHeightMultiChunk)
|
||||
{
|
||||
CheckDecoderMultiChunk(CorruptICOWithBadBMPHeightTestCase());
|
||||
}
|
||||
|
||||
TEST(ImageDecoders, AnimatedGIFWithExtraImageSubBlocks)
|
||||
{
|
||||
ImageTestCase testCase = ExtraImageSubBlocksAnimatedGIFTestCase();
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 41 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 41 KiB |
|
@ -31,6 +31,8 @@ SOURCES += [
|
|||
|
||||
TEST_HARNESS_FILES.gtest += [
|
||||
'animated-with-extra-image-sub-blocks.gif',
|
||||
'corrupt-with-bad-bmp-height.ico',
|
||||
'corrupt-with-bad-bmp-width.ico',
|
||||
'corrupt.jpg',
|
||||
'downscaled.bmp',
|
||||
'downscaled.gif',
|
||||
|
|
Загрузка…
Ссылка в новой задаче