]> granicus.if.org Git - libjpeg-turbo/commitdiff
The previous attempt to handle unexpected markers in the data stream caused breakage...
authorDRC <dcommander@users.sourceforge.net>
Sat, 16 Apr 2011 17:39:58 +0000 (17:39 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sat, 16 Apr 2011 17:39:58 +0000 (17:39 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@582 632fc199-4ca6-4c93-a231-07263d6284db

jdhuff.c

index f6b6e0087e06d48260bf45491659b3728e869e7f..ad1112ec91928fb13d614d66c8cb3957305cf4c6 100644 (file)
--- a/jdhuff.c
+++ b/jdhuff.c
@@ -740,9 +740,9 @@ decode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
     }
   }
 
-  if (cinfo->unread_marker != 0 && ! cinfo->entropy->insufficient_data) {
-    WARNMS(cinfo, JWRN_HIT_MARKER);
-    cinfo->entropy->insufficient_data = TRUE;
+  if (cinfo->unread_marker != 0) {
+    cinfo->unread_marker = 0;
+    return FALSE;
   }
 
   br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
@@ -793,9 +793,10 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
   if (! entropy->pub.insufficient_data) {
 
     if (usefast) {
-      if (!decode_mcu_fast(cinfo, MCU_data)) return FALSE;
+      if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;
     }
     else {
+      use_slow:
       if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
     }