rev 359 - trunk

[email protected] Wed, 8 Dec 2004 12:49:20 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2004-12-08 12:49:19 -0800 (Wed, 08 Dec 2004)
New Revision: 359

Modified:
   trunk/jbig2_symbol_dict.c
Log:
Error if the symbol id indicated for refinement in a refagg symbol=20
dictionary segment is out of range. UBC test stream 042_13 triggers
this, we don't fix this here, only handle the error more verbosely.


Modified: trunk/jbig2_symbol_dict.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_symbol_dict.c	2004-12-07 01:37:45 UTC (rev 358)
+++ trunk/jbig2_symbol_dict.c	2004-12-08 20:49:19 UTC (rev 359)
@@ -387,6 +387,10 @@
 		          code =3D jbig2_arith_int_decode(IARDY, as, &RDY);
 		      }
=20
+		      if (ID >=3D ninsyms+NSYMSDECODED)
+			return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+			  "refinement references unknown symbol %d", ID);
+  =20
 		      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
 			"symbol is a refinement of id %d with the refinement applied at (%d,%=
d)",
 			ID, RDX, RDY);
@@ -395,7 +399,7 @@
=20
 		      /* Table 18 */
 		      rparams.GRTEMPLATE =3D params->SDRTEMPLATE;
-		      rparams.reference =3D (ninsyms > ID) ?=20
+		      rparams.reference =3D (ninsyms >=3D ID) ?=20
 					params->SDINSYMS->glyphs[ID] :
 					SDNEWSYMS->glyphs[ID-ninsyms];
 		      rparams.DX =3D RDX;