GIF loader: Fix segv on images without colormap.

Not sure what is the proper way to handle this.
For now we just fill the image with zeros.
This commit is contained in:
Kim Woelders 2013-12-31 17:50:18 +01:00
parent b7ad34abbc
commit 39641e74a5
1 changed files with 9 additions and 0 deletions

View File

@ -142,6 +142,14 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
if (!im->data)
goto quit;
if (!cmap)
{
/* No colormap? Now what?? Let's clear the image (and not segv) */
memset(im->data, 0, sizeof(DATA32) * w * h);
rc = 1;
goto finish;
}
ptr = im->data;
per_inc = 100.0 / (((float)w) * h);
for (i = 0; i < h; i++)
@ -177,6 +185,7 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
}
}
finish:
if (progress)
progress(im, 100, 0, last_y, w, h);
}