[Scummvm-cvs-logs] scummvm master -> 6ae97cdfbe88fa34363aabc46847b0c9a32eefe5

clone2727 clone2727 at gmail.com
Sat Jan 26 18:01:19 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6ae97cdfbe GRAPHICS: Modify the JFIF version warning


Commit: 6ae97cdfbe88fa34363aabc46847b0c9a32eefe5
    https://github.com/scummvm/scummvm/commit/6ae97cdfbe88fa34363aabc46847b0c9a32eefe5
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2013-01-26T08:56:13-08:00

Commit Message:
GRAPHICS: Modify the JFIF version warning

v1.02 images should only differ with the thumbnail from v1.01, and should be handled correctly by our decoder.

Changed paths:
    graphics/decoders/jpeg.cpp



diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp
index 08bc1f7..5e926e6 100644
--- a/graphics/decoders/jpeg.cpp
+++ b/graphics/decoders/jpeg.cpp
@@ -215,28 +215,34 @@ bool JPEGDecoder::loadStream(Common::SeekableReadStream &stream) {
 bool JPEGDecoder::readJFIF() {
 	uint16 length = _stream->readUint16BE();
 	uint32 tag = _stream->readUint32BE();
+
 	if (tag != MKTAG('J', 'F', 'I', 'F')) {
 		warning("JPEGDecoder::readJFIF() tag mismatch");
 		return false;
 	}
+
 	if (_stream->readByte() != 0)  { // NULL
 		warning("JPEGDecoder::readJFIF() NULL mismatch");
 		return false;
 	}
+
 	byte majorVersion = _stream->readByte();
 	byte minorVersion = _stream->readByte();
-	if (majorVersion != 1 || minorVersion != 1)
-		warning("JPEGDecoder::readJFIF() Non-v1.1 JPEGs may not be handled correctly");
+	if (majorVersion != 1 || minorVersion > 2)
+		warning("JPEGDecoder::readJFIF(): v%d.%02d JPEGs may not be handled correctly", majorVersion, minorVersion);
+
 	/* byte densityUnits = */_stream->readByte();
 	/* uint16 xDensity = */_stream->readUint16BE();
 	/* uint16 yDensity = */_stream->readUint16BE();
 	byte thumbW = _stream->readByte();
 	byte thumbH = _stream->readByte();
+
 	_stream->seek(thumbW * thumbH * 3, SEEK_CUR); // Ignore thumbnail
 	if (length != (thumbW * thumbH * 3) + 16) {
 		warning("JPEGDecoder::readJFIF() length mismatch");
 		return false;
 	}
+
 	return true;
 }
 






More information about the Scummvm-git-logs mailing list