Validate number of colors in XCF colormaps

This commit is contained in:
Mukund Sivaraman 2010-10-16 04:22:11 +05:30
parent 4855d433b0
commit f1a7db80c9
1 changed files with 9 additions and 0 deletions

View File

@ -398,6 +398,15 @@ xcf_load_image_props (XcfInfo *info,
info->cp += xcf_read_int32 (info->fp, &n_colors, 1);
if (n_colors > (GIMP_IMAGE_COLORMAP_SIZE / 3))
{
gimp_message (info->gimp, G_OBJECT (info->progress),
GIMP_MESSAGE_ERROR,
"Maximum colormap size (%d) exceeded",
GIMP_IMAGE_COLORMAP_SIZE);
return FALSE;
}
if (info->file_version == 0)
{
gint i;