shithub: jbig2

Download patch

ref: d498a8c2f375315c2de3c62ea270e447bf0bde44
parent: f77dcdbe70ec1ba574ba25c37de81dfaf27ebc52
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Jun 12 05:15:13 EDT 2001

make get_next_word return uint32


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@25 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/jbig2dec.c
+++ b/jbig2dec.c
@@ -8,7 +8,7 @@
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    $Id: jbig2dec.c,v 1.3 2001/06/10 07:09:18 giles Exp $
+    $Id: jbig2dec.c,v 1.4 2001/06/12 09:15:13 giles Exp $
 */
 
 #include <stdio.h>
@@ -88,13 +88,14 @@
   ctx->flags = buf[8];
   if (ctx->flags & 2)
     {
-      ctx->offset = 9;
+      ctx->offset = 9;	/* number of pages unknown */
+	  ctx->n_pages = 0;
     }
   else
     {
       ctx->offset = 13;
       ctx->n_pages = get_int32 (ctx, 9);
-    }
+	}
   return ctx;
 }
 
@@ -229,6 +230,8 @@
   bool last;
 
   ctx = jbig2_open (f);
+  if (!ctx) return;
+  
   printf ("Number of pages = %d\n", ctx->n_pages);
   for (;;)
     {
--- a/jbig2dec.h
+++ b/jbig2dec.h
@@ -8,7 +8,7 @@
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    $Id: jbig2dec.h,v 1.2 2001/06/10 07:09:18 giles Exp $
+    $Id: jbig2dec.h,v 1.3 2001/06/12 09:15:13 giles Exp $
 */
 
 typedef unsigned char byte;
@@ -40,5 +40,5 @@
 typedef struct _Jbig2WordStream Jbig2WordStream;
 
 struct _Jbig2WordStream {
-  int32 (*get_next_word) (Jbig2WordStream *self, int offset);
+  uint32 (*get_next_word) (Jbig2WordStream *self, int offset);
 };