shithub: jbig2

Download patch

ref: 3b182de2e206756ddcdd715d8f561273f75a62c2
parent: a5f7064637d1d9efe7c0a0920d81f70f99c6d456
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Jul 2 20:10:07 EDT 2002

We've been using (and want) the image stride in bytes, not words.


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

--- a/jbig2.h
+++ b/jbig2.h
@@ -8,7 +8,7 @@
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
         
-    $Id: jbig2.h,v 1.9 2002/06/22 16:05:45 giles Exp $
+    $Id: jbig2.h,v 1.10 2002/07/03 00:10:07 giles Exp $
 */
 
 #ifdef __cplusplus
@@ -43,7 +43,7 @@
 /*
    this is the general image structure used by the jbig2dec library
    images are 1 bpp, packed into word-aligned rows. stride gives
-   the word offset to the next row, while width and height define
+   the byte offset to the next row, while width and height define
    the size of the image area in pixels.
 */
 
--- a/jbig2_image.c
+++ b/jbig2_image.c
@@ -1,7 +1,7 @@
 /*
     jbig2dec
     
-    Copyright (c) 2001 artofcode LLC.
+    Copyright (c) 2001-2002 artofcode LLC.
     
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -8,7 +8,7 @@
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    $Id: jbig2_image.c,v 1.7 2002/06/24 15:51:57 giles Exp $
+    $Id: jbig2_image.c,v 1.8 2002/07/03 00:10:07 giles Exp $
 */
 
 #include <stdio.h>
@@ -33,8 +33,8 @@
 		return NULL;
 	}
 	
-	stride = (((width - 1) >> 5) + 1) << 2;	/* generate a word-aligned stride */
-	image->data = (uint32_t *)jbig2_alloc(ctx->allocator, (stride*height));
+	stride = ((width - 1) >> 5) + 1;	/* generate a word-aligned stride */
+	image->data = (uint32_t *)jbig2_alloc(ctx->allocator, stride*height);
 	if (image->data == NULL) {
                 jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
                     "could not allocate image data buffer! [%d bytes]\n", stride*height);