[jbig2-cvs] rev 412 - trunk

giles at ghostscript.com giles at ghostscript.com
Wed Jun 15 07:09:36 PDT 2005


Author: giles
Date: 2005-06-15 07:09:35 -0700 (Wed, 15 Jun 2005)
New Revision: 412

Modified:
   trunk/jbig2_symbol_dict.c
Log:
Fail on fatal symbol dict decoding errors.


Modified: trunk/jbig2_symbol_dict.c
===================================================================
--- trunk/jbig2_symbol_dict.c	2005-06-08 14:23:43 UTC (rev 411)
+++ trunk/jbig2_symbol_dict.c	2005-06-15 14:09:35 UTC (rev 412)
@@ -375,16 +375,19 @@
 		  } else {
 		      code = jbig2_arith_int_decode(IAAI, as, (int32_t*)&REFAGGNINST);
 		  }
-		  if (code || (int32_t)REFAGGNINST <= 0)
-		      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+		  if (code || (int32_t)REFAGGNINST <= 0) {
+		      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			"invalid number of symbols or OOB in aggregate glyph");
+		      return NULL;
+		  }
 
 		  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
 		    "aggregate symbol coding (%d instances)", REFAGGNINST);
 
 		  if (REFAGGNINST > 1) {
-		      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+		      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			"aggregate coding with REFAGGNINST=%d", REFAGGNINST);
+		      return NULL;
 		      /* todo: multiple symbols are like a text region */
 		  } else {
 		      /* 6.5.8.2.2 */
@@ -405,7 +408,7 @@
 
 
 		      if (ID >= ninsyms+NSYMSDECODED) {
-			jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+			code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			  "refinement references unknown symbol %d", ID);
 			return NULL;
 		      }
@@ -448,14 +451,16 @@
 #endif
 
 	  } else {
-	      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+	      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
                 "unhandled bitmap case!!!");
+	      return NULL;
           }
 
 	  /* 6.5.5 (4c.iii) */
 	  if (params->SDHUFF && !params->SDREFAGG) {
-	    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+	    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
               "NYI: parsing collective bitmaps!!!");
+	    return NULL;
 	  }
 	
 	  /* 6.5.5 (4c.iv) */



More information about the jbig2-cvs mailing list