forked from mirrors/gecko-dev
Bug 1780834. If a webp file header specifies ICCP but no ICCP chunk is found just ignore it and continue. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D152588
This commit is contained in:
parent
c793385bec
commit
b5a9365200
5 changed files with 16 additions and 7 deletions
|
|
@ -361,14 +361,19 @@ LexerResult nsWebPDecoder::ReadHeader(WebPDemuxer* aDemuxer, bool aIsComplete) {
|
|||
if (!IsMetadataDecode() && !mGotColorProfile) {
|
||||
if (flags & WebPFeatureFlags::ICCP_FLAG) {
|
||||
WebPChunkIterator iter;
|
||||
if (!WebPDemuxGetChunk(aDemuxer, "ICCP", 1, &iter)) {
|
||||
return aIsComplete ? LexerResult(TerminalState::FAILURE)
|
||||
: LexerResult(Yield::NEED_MORE_DATA);
|
||||
}
|
||||
if (WebPDemuxGetChunk(aDemuxer, "ICCP", 1, &iter)) {
|
||||
ApplyColorProfile(reinterpret_cast<const char*>(iter.chunk.bytes),
|
||||
iter.chunk.size);
|
||||
WebPDemuxReleaseChunkIterator(&iter);
|
||||
|
||||
ApplyColorProfile(reinterpret_cast<const char*>(iter.chunk.bytes),
|
||||
iter.chunk.size);
|
||||
WebPDemuxReleaseChunkIterator(&iter);
|
||||
} else {
|
||||
MOZ_LOG(sWebPLog, LogLevel::Warning,
|
||||
("[this=%p] nsWebPDecoder::ReadHeader header specified ICCP "
|
||||
"but no ICCP chunk found, ignoring\n",
|
||||
this));
|
||||
|
||||
ApplyColorProfile(nullptr, 0);
|
||||
}
|
||||
} else {
|
||||
ApplyColorProfile(nullptr, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,3 +51,6 @@ skip-if(useDrawSnapshot) include downscaling/reftest.list
|
|||
|
||||
# Lossless encoders
|
||||
include encoders-lossless/reftest.list
|
||||
|
||||
# webp tests
|
||||
include webp/reftest.list
|
||||
|
|
|
|||
BIN
image/test/reftest/webp/blue.png
Normal file
BIN
image/test/reftest/webp/blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 B |
BIN
image/test/reftest/webp/icc-bit-no-icc-chunk.webp
Normal file
BIN
image/test/reftest/webp/icc-bit-no-icc-chunk.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 B |
1
image/test/reftest/webp/reftest.list
Normal file
1
image/test/reftest/webp/reftest.list
Normal file
|
|
@ -0,0 +1 @@
|
|||
== icc-bit-no-icc-chunk.webp blue.png
|
||||
Loading…
Reference in a new issue