plug-ins: Fix rounding error in PCX load

Some valid PCX/DCX files wouldn't load because the bytes per line
header check can be off by one due to integer division rounding.
This adds 1 to the equation to account for this.
This commit is contained in:
Alx Sa 2023-04-11 21:39:05 -04:00
parent 7bc7273d04
commit da217088d0
1 changed files with 1 additions and 1 deletions

View File

@ -713,7 +713,7 @@ load_image (GimpProcedure *procedure,
fclose (fd);
return NULL;
}
if (bytesperline < ((width * pcx_header.bpp + 7) / 8))
if ((bytesperline + 1) < ((width * pcx_header.bpp + 7) / 8))
{
g_message (_("Invalid number of bytes per line in PCX header"));
fclose (fd);