Fix an issue that resulted in an error ("Invalid SOS parameters for sequential JPEG. Didn't expect more than one scan.") when decoding progressive+arithmetic JPEGs generated by libjpeg-turbo.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1049 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-09-28 03:04:01 +00:00
2 changed files with 7 additions and 5 deletions

View File

@@ -14,10 +14,8 @@ When using a 32-bit version of CMake on 64-bit Windows, it is impossible to
access the c:\WINDOWS\system32 directory, which made it impossible for the access the c:\WINDOWS\system32 directory, which made it impossible for the
TurboVNC build scripts to bundle the 64-bit TurboJPEG DLL. TurboVNC build scripts to bundle the 64-bit TurboJPEG DLL.
[3] Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic [3] Fixed a couple of bugs that prevented libjpeg-turbo from encoding or
entropy coding (by passing arguments of -progressive -arithmetic to cjpeg or decoding progressive JPEGs with arithmetic entropy coding.
jpegtran, for instance) would result in an error, "Requested feature was
omitted at compile time".
1.3.0 1.3.0

View File

@@ -3,6 +3,7 @@
* *
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* Modifications: * Modifications:
* Copyright (C) 2010, D. R. Commander. * Copyright (C) 2010, D. R. Commander.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
@@ -532,7 +533,10 @@ write_frame_header (j_compress_ptr cinfo)
/* Emit the proper SOF marker */ /* Emit the proper SOF marker */
if (cinfo->arith_code) { if (cinfo->arith_code) {
emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */
else
emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
} else { } else {
if (cinfo->progressive_mode) if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */