diff options
-rw-r--r-- | src/create.c | 6 | ||||
-rw-r--r-- | src/scan.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/create.c b/src/create.c index a1e274d..8bf9d2e 100644 --- a/src/create.c +++ b/src/create.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/extras/Xpm/lib/create.c,v 1.2.4.1 2004/09/15 15:47:39 daniel Exp $ */ +/* $XdotOrg: xc/extras/Xpm/lib/create.c,v 1.4 2004/11/25 21:19:11 herrb Exp $ */ /* * Copyright (C) 1989-95 GROUPE BULL * @@ -1215,10 +1215,10 @@ PutImagePixels(image, width, height, pixelindex, pixels) register char *src; register char *dst; register unsigned int *iptr; - register unsigned int x, y, i; + register unsigned int x, y; register char *data; Pixel pixel, px; - int nbytes, depth, ibu, ibpp; + int nbytes, depth, ibu, ibpp, i; data = image->data; iptr = pixelindex; @@ -621,8 +621,8 @@ GetImagePixels(image, width, height, pmap) char *dst; unsigned int *iptr; char *data; - unsigned int x, y, i; - int bits, depth, ibu, ibpp, offset; + unsigned int x, y; + int bits, depth, ibu, ibpp, offset, i; unsigned long lbt; Pixel pixel, px; @@ -633,6 +633,9 @@ GetImagePixels(image, width, height, pmap) ibpp = image->bits_per_pixel; offset = image->xoffset; + if (image->bitmap_unit < 0) + return (XpmNoMemory); + if ((image->bits_per_pixel | image->depth) == 1) { ibu = image->bitmap_unit; for (y = 0; y < height; y++) |