Fixed a warning when compiling

This commit is contained in:
Pierre Pronchery 2010-03-09 23:05:38 +00:00
parent 739825cbeb
commit 39c0960d96

View File

@ -480,8 +480,8 @@ static GdkPixbuf * _do_pixbuf(Tasks * tasks, Window window)
unsigned long cnt = 0; unsigned long cnt = 0;
unsigned long * buf = NULL; unsigned long * buf = NULL;
unsigned long i; unsigned long i;
unsigned long width; long width;
unsigned long height; long height;
unsigned long size; unsigned long size;
unsigned char * pixbuf; unsigned char * pixbuf;
unsigned long j; unsigned long j;
@ -496,7 +496,7 @@ static GdkPixbuf * _do_pixbuf(Tasks * tasks, Window window)
height = buf[i + 1]; height = buf[i + 1];
if(i + 2 + (width * height) > cnt) if(i + 2 + (width * height) > cnt)
break; break;
if(width == 0 || height == 0 || width != height) if(width <= 0 || height <= 0 || width != height)
continue; continue;
size = width * height * 4; size = width * height * 4;
if((pixbuf = malloc(size)) == NULL) if((pixbuf = malloc(size)) == NULL)