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