rev 464 - trunk
[email protected] Fri, 9 May 2008 06:54:33 -0700 (PDT)
| Newsgroups | gmane.comp.printing.ghostscript.jbig2dec.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: giles
Date: 2008-05-09 06:54:32 -0700 (Fri, 09 May 2008)
New Revision: 464
Modified:
trunk/jbig2_text.c
Log:
Runcodes 33 and 34 repeat a zero code length symbol id, not the previous
symbol like runcode 32.
Thanks to Justin Greer for the fix. Ghostscript bug 689824.
Modified: trunk/jbig2_text.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/jbig2_text.c 2008-05-09 13:41:01 UTC (rev 463)
+++ trunk/jbig2_text.c 2008-05-09 13:54:32 UTC (rev 464)
@@ -147,7 +147,11 @@
/* todo: memory cleanup */
return -1;
}
- len =3D symcodelengths[index-1].PREFLEN;
+ if (code =3D=3D 32) {
+ len =3D symcodelengths[index-1].PREFLEN;
+ } else {
+ len =3D 0; /* code =3D=3D 33 or 34 */
+ }
if (code =3D=3D 32) range =3D jbig2_huffman_get_bits(hs, 2) + 3;
else if (code =3D=3D 33) range =3D jbig2_huffman_get_bits(hs, 3) + =
3;
else if (code =3D=3D 34) range =3D jbig2_huffman_get_bits(hs, 7) + =
11;