shithub: jbig2

Download patch

ref: ad742b847dbb39b1376664d77fae0f8b31ae65f0
parent: fd7cb7fa6152573ab11ebfbce45582fa1652f117
author: Ralph Giles <giles@ghostscript.com>
date: Fri Nov 20 04:46:39 EST 2009

Skip generic regions using TPGDON and issue a warning.

We don't yet implement this, and discarding the data is better than
proceeding with the incorrect decoding proceedures, which generally
just produce noise. Ghostscript bug 690791.

--- a/jbig2_generic.c
+++ b/jbig2_generic.c
@@ -494,6 +494,11 @@
 {
   const int8_t *gbat = params->gbat;
 
+  if (!params->MMR && params->TPGDON) {
+    return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+	"NYI: typical prediction in a generic region\n");
+  }
+
   if (!params->MMR && params->GBTEMPLATE == 0) {
     if (gbat[0] == +3 && gbat[1] == -1 &&
         gbat[2] == -3 && gbat[3] == -1 &&