From 02bad34a414dbf5ade258efa26903e83dce5524a Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Thu, 8 Oct 2020 13:54:24 -0400 Subject: [PATCH] Issue #5735: incorrect condition because of missing parenthesis. Also taking the opportunity to change the minimum size since I apparently counted it wrong. The size always seems to be 46 starting from psp file-version 4 up to and including the current version 13. --- plug-ins/common/file-psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c index 9678e10674..23872ccae4 100644 --- a/plug-ins/common/file-psp.c +++ b/plug-ins/common/file-psp.c @@ -1001,7 +1001,7 @@ read_general_image_attribute_block (FILE *f, chunk_start = ftell (f); if ((psp_ver_major >= 4 - && (fread (&init_len, 4, 1, f) < 1 || (init_len = GUINT32_FROM_LE (init_len) < 42))) + && (fread (&init_len, 4, 1, f) < 1 || ((init_len = GUINT32_FROM_LE (init_len)) < 46))) || fread (&ia->width, 4, 1, f) < 1 || fread (&ia->height, 4, 1, f) < 1 || fread (&res, 8, 1, f) < 1