[jbig2-cvs] rev 359 - trunk

giles at ghostscript.com giles at ghostscript.com
Wed Dec 8 12:49:20 PST 2004


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 
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
===================================================================
--- 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 = jbig2_arith_int_decode(IARDY, as, &RDY);
 		      }
 
+		      if (ID >= ninsyms+NSYMSDECODED)
+			return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+			  "refinement references unknown symbol %d", ID);
+   
 		      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 @@
 
 		      /* Table 18 */
 		      rparams.GRTEMPLATE = params->SDRTEMPLATE;
-		      rparams.reference = (ninsyms > ID) ? 
+		      rparams.reference = (ninsyms >= ID) ? 
 					params->SDINSYMS->glyphs[ID] :
 					SDNEWSYMS->glyphs[ID-ninsyms];
 		      rparams.DX = RDX;



More information about the jbig2-cvs mailing list