rev 367 - trunk

[email protected] Mon, 20 Dec 2004 16:35:02 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2004-12-20 16:35:02 -0800 (Mon, 20 Dec 2004)
New Revision: 367

Modified:
   trunk/CHANGES
   trunk/jbig2_page.c
Log:
Re-assign the return value of jbig2_realloc() when growning the page=20
size array. Previously it was dropped which could cause crashes on some=20
systems processing documents with more than 4 pages. Thanks to Jan=20
Patera for reporting this.


Modified: trunk/CHANGES
=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/CHANGES	2004-12-13 20:00:09 UTC (rev 366)
+++ trunk/CHANGES	2004-12-21 00:35:02 UTC (rev 367)
@@ -1,6 +1,6 @@
 Version 0.8 (unreleased)
=20
- * no changes as of yet
+ * Fix an allocation error in the page array
=20
 Version 0.7 (2004 December 8)
=20

Modified: trunk/jbig2_page.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_page.c	2004-12-13 20:00:09 UTC (rev 366)
+++ trunk/jbig2_page.c	2004-12-21 00:35:02 UTC (rev 367)
@@ -85,7 +85,8 @@
             index++;
             if (index >=3D ctx->max_page_index) { /* FIXME: should also =
look for freed pages? */
                 /* grow the list */
-                jbig2_realloc(ctx->allocator, ctx->pages, (ctx->max_page=
_index <<=3D 2) * sizeof(Jbig2Page));
+                ctx->pages =3D jbig2_realloc(ctx->allocator, ctx->pages,
+			(ctx->max_page_index <<=3D 2) * sizeof(Jbig2Page));
                 for (j=3Dindex; j < ctx->max_page_index; j++) {
                     /* note to raph: and look, it gets worse! */
                     ctx->pages[j].state =3D JBIG2_PAGE_FREE;