rev 439 - trunk

[email protected] Mon, 5 Dec 2005 16:02:28 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2005-12-02 19:35:00 -0800 (Fri, 02 Dec 2005)
New Revision: 439

Modified:
   trunk/jbig2_symbol_dict.c
Log:
Correct an operator precedence bug that was corrupting reading of uncompr=
essed
collective bitmaps. Also improve debugging messages.


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-12-01 23:56:54 UTC (rev 438)
+++ trunk/jbig2_symbol_dict.c	2005-12-03 03:35:00 UTC (rev 439)
@@ -499,27 +499,31 @@
 	  return NULL;
 	}
=20
-	jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
-	  "reading %dx%d collective bitmap for %d symbols (%d bytes%s)",
-	  image->width, image->height, NSYMSDECODED - HCFIRSTSYM,
-	  BMSIZE, BMSIZE ? "" : " uncompressed");
-
 	if (BMSIZE =3D=3D 0) {
 	  /* if BMSIZE =3D=3D 0 bitmap is uncompressed */
 	  const byte *src =3D data + jbig2_huffman_offset(hs);
 	  const int stride =3D (image->width >> 3) +=20
-		(image->width & 7) ? 1 : 0;
+		((image->width & 7) ? 1 : 0);
 	  byte *dst =3D image->data;
=20
+	  BMSIZE =3D image->height * stride;
+	  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+	    "reading %dx%d uncompressed bitmap"
+	    " for %d symbols (%d bytes)",
+	    image->width, image->height, NSYMSDECODED - HCFIRSTSYM, BMSIZE);
+
 	  for (j =3D 0; j < image->height; j++) {
 	    memcpy(dst, src, stride);
 	    dst +=3D image->stride;
 	    src +=3D stride;
 	  }
-	  BMSIZE =3D image->height * stride;
 	} else {
 	  Jbig2GenericRegionParams rparams;
=20
+	  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+	    "reading %dx%d collective bitmap for %d symbols (%d bytes)",
+	    image->width, image->height, NSYMSDECODED - HCFIRSTSYM, BMSIZE);
+
 	  rparams.MMR =3D 1;
 	  code =3D jbig2_decode_generic_mmr(ctx, segment, &rparams,
 	    data + jbig2_huffman_offset(hs), BMSIZE, image);