refuse to open PSD files with insanely large dimensions (#244402, fix by

Sven Ne umann)
This commit is contained in:
Nils Philippsen 2007-06-27 15:05:53 +00:00
parent 68e333298f
commit e762f346ca

View File

@ -0,0 +1,19 @@
--- gimp-2.2.15/plug-ins/common/psd.c.psd-invalid-dimensions 2007-04-17 23:11:24.000000000 +0200
+++ gimp-2.2.15/plug-ins/common/psd.c 2007-06-27 13:06:24.000000000 +0200
@@ -1199,9 +1199,15 @@ seek_to_and_unpack_pixeldata(FILE* fd, g
compression = getgshort(fd, "layer channel compression type");
offset+=2;
- width = channel->width;
+ width = channel->width;
height = channel->height;
+ if (width > G_MAXINT16 || height > G_MAXINT16)
+ {
+ g_message ("Error: Invalid channel dimensions");
+ gimp_quit ();
+ }
+
IFDBG
{
printf("\t\t\tLayer (%d) Channel (%d:%d) Compression: %d (%s)\n",