From c5363006edf0744adfd0b48a67389213b8bea9ba Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 19 Apr 2012 11:49:06 -0400 Subject: GRAPHICS: Only accept JPEG CompressedQuickTime PICT opcodes --- graphics/decoders/pict.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/decoders/pict.cpp b/graphics/decoders/pict.cpp index 957342084e..9963873b54 100644 --- a/graphics/decoders/pict.cpp +++ b/graphics/decoders/pict.cpp @@ -541,10 +541,14 @@ void PICTDecoder::decodeCompressedQuickTime(Common::SeekableReadStream &stream) // Now we've reached the image descriptor, so read the relevant data from that uint32 idStart = stream.pos(); uint32 idSize = stream.readUint32BE(); - stream.skip(40); // miscellaneous stuff + uint32 codec = stream.readUint32BE(); + stream.skip(36); // miscellaneous stuff uint32 jpegSize = stream.readUint32BE(); stream.skip(idSize - (stream.pos() - idStart)); // more useless stuff + if (codec != MKTAG('j', 'p', 'e', 'g')) + error("Unhandled CompressedQuickTime format '%s'", tag2str(codec)); + Common::SeekableSubReadStream jpegStream(&stream, stream.pos(), stream.pos() + jpegSize); JPEGDecoder jpeg; -- cgit v1.2.3