shithub: jbig2

Download patch

ref: f51764fe4b4b31733ac1dc5c3d103106b9594c8d
parent: 342ea4778d0ab98d8aabbaf62c2866afb804359d
author: masaki <masaki@a1074d23-0009-0410-80fe-cf8c14f379e6>
date: Wed Apr 21 03:20:14 EDT 2010

A fix for a regression introduced by r11074 (bug 690094).

As I changed image number to be incremented when 'exflag' is false,
the problem of 'exrunlength' when SDHUFF == 1 was unveiled.
This fixes it.
JBIG2 images with SDHUFF == 1 should have been having trouble
between r11074 and this revision.  No other difference expected.

git-svn-id: http://svn.ghostscript.com/ghostscript/trunk/gs/jbig2dec/@11093 a1074d23-0009-0410-80fe-cf8c14f379e6
(cherry picked from commit 44b9be2b31622c91b8cb3e4acc6160269630d838)

Signed-off-by: Masaki Ushizaka <masaki@ghostscript.com>

--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -693,7 +693,7 @@
     while (j < params->SDNUMEXSYMS) {
       if (params->SDHUFF)
       	/* FIXME: implement reading from huff table B.1 */
-        exrunlength = params->SDNUMEXSYMS;
+        exrunlength = exflag ? params->SDNUMEXSYMS : 0;
       else
         code = jbig2_arith_int_decode(IAEX, as, &exrunlength);
       if (exflag && exrunlength > params->SDNUMEXSYMS - j) {