From c44750e50e159bbbb00c0922e77579b9e09c6467 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 6 Nov 2013 07:37:01 +0000 Subject: [PATCH] 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.2.x@1081 632fc199-4ca6-4c93-a231-07263d6284db --- jcmarker.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jcmarker.c b/jcmarker.c index 06fe6239..e5b627fb 100644 --- a/jcmarker.c +++ b/jcmarker.c @@ -3,6 +3,7 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2003-2010 by Guido Vollbeding. * Modifications: * Copyright (C) 2010, D. R. Commander. * 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 */ 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 { if (cinfo->progressive_mode) emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */