From 62de12281aa6c45d1c7f74039d84d89b8036d5ad Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 16 Apr 2011 18:50:42 +0000 Subject: [PATCH] This is subtle, but an unread marker is not an error unless we run out of bits, which may not occur in the same MCU in which the unread marker is encountered. Thus, don't try to use the fast decoder as long as there is an outstanding unread marker. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@583 632fc199-4ca6-4c93-a231-07263d6284db --- jdhuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdhuff.c b/jdhuff.c index ad1112e..b795462 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -784,7 +784,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) usefast = 0; } - if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU) + if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU + || cinfo->unread_marker != 0) usefast = 0; /* If we've run out of data, just leave the MCU set to zeroes. -- 2.40.0