1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
https://gitlab.gnome.org/GNOME/gimp/-/issues/12790#note_2328950
--- gimp-2.10.34.orig/plug-ins/file-dds/ddsread.c
+++ gimp-2.10.34/plug-ins/file-dds/ddsread.c
@@ -934,6 +934,14 @@ load_layer (FILE *fp,
if (width < 1) width = 1;
if (height < 1) height = 1;
+ if (width <= 0 ||height <= 0 || d->gimp_bpp <= 0 ||
+ (gsize) width > G_MAXSIZE / height ||
+ (gsize) width * height > G_MAXSIZE / d->gimp_bpp)
+ {
+ g_message ("Invalid dimensions in header.");
+ return 0;
+ }
+
switch (d->bpp)
{
case 1:
|