shithub: jbig2

Download patch

ref: 4a8c95e32a1a05dbf5587ff2262ea225f2dd6c2b
parent: 0d128dbed01e775befd59050c415b5aa7f21562d
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Wed Jul 27 13:29:03 EDT 2005

Commit an off-by-one fix from Alex Cherepanov related to bug 688244.

Also #ifdef protect a debug image dump that was preventing compilation
in Ghostscript.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@418 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -436,7 +436,7 @@
 
 		      /* Table 18 */
 		      rparams.GRTEMPLATE = params->SDRTEMPLATE;
-		      rparams.reference = (ninsyms >= ID) ? 
+		      rparams.reference = (ID < ninsyms) ? 
 					params->SDINSYMS->glyphs[ID] :
 					SDNEWSYMS->glyphs[ID-ninsyms];
 		      rparams.DX = RDX;
@@ -523,7 +523,9 @@
 	rparams.MMR = 1;
 	code = jbig2_decode_generic_mmr(ctx, segment, &rparams,
 	    data + jbig2_huffman_offset(hs), BMSIZE, image);
+#ifdef OUTPUT_PBM
         jbig2_image_write_pbm_file(image, "collective.pbm");
+#endif
 	jbig2_dump_huffman_state(hs);
 	jbig2_huffman_advance(hs, BMSIZE);
 	jbig2_dump_huffman_state(hs);