forked from old/legacy-imlib2
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:
parent
b7ad34abbc
commit
39641e74a5
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue