aboutsummaryrefslogtreecommitdiff
path: root/graphics/decoders
diff options
context:
space:
mode:
authorMatthew Hoops2012-04-19 11:49:06 -0400
committerMatthew Hoops2012-04-19 11:49:06 -0400
commitc5363006edf0744adfd0b48a67389213b8bea9ba (patch)
tree47398bc280d40bd73efc7c5664658a807a1aa0df /graphics/decoders
parent4520b115e97b494bd5d13599f27a5a339465f88e (diff)
downloadscummvm-rg350-c5363006edf0744adfd0b48a67389213b8bea9ba.tar.gz
scummvm-rg350-c5363006edf0744adfd0b48a67389213b8bea9ba.tar.bz2
scummvm-rg350-c5363006edf0744adfd0b48a67389213b8bea9ba.zip
GRAPHICS: Only accept JPEG CompressedQuickTime PICT opcodes
Diffstat (limited to 'graphics/decoders')
-rw-r--r--graphics/decoders/pict.cpp6
1 files changed, 5 insertions, 1 deletions
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;