summaryrefslogtreecommitdiff
path: root/src/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scan.c')
-rw-r--r--src/scan.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scan.c b/src/scan.c
index 69c987b..28191e8 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -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++)