mirror of https://github.com/GNOME/gimp.git
PCX: sanitize input data
Harden PCX plugin against bad width, height.
This commit is contained in:
parent
f3235e6f45
commit
ed7f48be05
|
@ -405,6 +405,13 @@ load_image (const gchar *filename,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Shield against potential buffer overflows in load_*() functions. */
|
||||
if (G_MAXSIZE / width / height < 3)
|
||||
{
|
||||
g_message (_("Image dimensions too large: width %d x height %d"), width, height);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pcx_header.planes == 3 && pcx_header.bpp == 8)
|
||||
{
|
||||
image= gimp_image_new (width, height, GIMP_RGB);
|
||||
|
|
Loading…
Reference in New Issue