Bug 1315554 - Part 1. Enforce the parent decoder size (ICO) for child decoders (BMP, PNG). r=tnikkel

This commit is contained in:
Andrew Osmond
2017-07-22 00:14:58 -04:00
parent 91e99f13f7
commit e5d030062e
6 changed files with 42 additions and 1 deletions

View File

@@ -236,6 +236,7 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
NotNull<SourceBuffer*> aSourceBuffer,
NotNull<nsICODecoder*> aICODecoder,
const Maybe<IntSize>& aExpectedSize,
const Maybe<uint32_t>& aDataOffset
/* = Nothing() */)
{
@@ -264,6 +265,9 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
decoder->SetMetadataDecode(aICODecoder->IsMetadataDecode());
decoder->SetIterator(aSourceBuffer->Iterator());
decoder->SetOutputSize(aICODecoder->OutputSize());
if (aExpectedSize) {
decoder->SetExpectedSize(*aExpectedSize);
}
decoder->SetDecoderFlags(aICODecoder->GetDecoderFlags());
decoder->SetSurfaceFlags(aICODecoder->GetSurfaceFlags());
decoder->SetFinalizeFrames(false);