plug-ins: PSD color block can have a non zero length even when mode is RGB.

Not taking a non zero length into consideration caused us to read from the
wrong location in certain cases and then fail loading.

Always use the specified length to go to the correct location. This is not
a guarantee that we will be able to correctly load the image but at least
we won't read wrong data from the wrong location.
This commit is contained in:
Jacob Boerema 2021-05-12 16:07:26 -04:00
parent 666ae4ecfe
commit 3d248dc66f
1 changed files with 9 additions and 0 deletions

View File

@ -457,6 +457,15 @@ read_color_mode_block (PSDimage *img_a,
return -1;
}
}
else
{
/* Apparently it's possible to have a non zero block_len here. */
if (! psd_seek (input, block_len, G_SEEK_CUR, error))
{
psd_set_error (error);
return -1;
}
}
/* Create color map for bitmap image */
if (img_a->color_mode == PSD_BITMAP)