forked from old/legacy-imlib2
XPM loader: Add missing pixels (malformed xpm)
If there are not enough pixels in the image data just fill in the first color. This way we will proceed without uninitialized pixel data avoiding valgrind complaints.
This commit is contained in:
parent
49a67a8f9c
commit
6ea4cf7e66
|
@ -431,6 +431,13 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
|||
done = 1;
|
||||
}
|
||||
|
||||
for (; count < pixels; count++)
|
||||
{
|
||||
/* Fill in missing pixels
|
||||
* (avoid working with uninitialized data in bad xpms) */
|
||||
im->data[count] = cmap[0].pixel;
|
||||
}
|
||||
|
||||
if (transp >= 0)
|
||||
{
|
||||
SET_FLAG(im->flags, F_HAS_ALPHA);
|
||||
|
|
Loading…
Reference in New Issue