rev 412 - trunk

[email protected] Wed, 15 Jun 2005 07:09:36 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
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
=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	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 =3D jbig2_arith_int_decode(IAAI, as, (int32_t*)&REFAGGNINST=
);
 		  }
-		  if (code || (int32_t)REFAGGNINST <=3D 0)
-		      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+		  if (code || (int32_t)REFAGGNINST <=3D 0) {
+		      code =3D jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			"invalid number of symbols or OOB in aggregate glyph");
+		      return NULL;
+		  }
=20
 		  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
 		    "aggregate symbol coding (%d instances)", REFAGGNINST);
=20
 		  if (REFAGGNINST > 1) {
-		      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+		      code =3D jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			"aggregate coding with REFAGGNINST=3D%d", REFAGGNINST);
+		      return NULL;
 		      /* todo: multiple symbols are like a text region */
 		  } else {
 		      /* 6.5.8.2.2 */
@@ -405,7 +408,7 @@
=20
=20
 		      if (ID >=3D ninsyms+NSYMSDECODED) {
-			jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+			code =3D jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 			  "refinement references unknown symbol %d", ID);
 			return NULL;
 		      }
@@ -448,14 +451,16 @@
 #endif
=20
 	  } else {
-	      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+	      code =3D jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
                 "unhandled bitmap case!!!");
+	      return NULL;
           }
=20
 	  /* 6.5.5 (4c.iii) */
 	  if (params->SDHUFF && !params->SDREFAGG) {
-	    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+	    code =3D jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
               "NYI: parsing collective bitmaps!!!");
+	    return NULL;
 	  }
 =09
 	  /* 6.5.5 (4c.iv) */