plug-ins: fix possible overflow in computation

FLI/FLC width x height is 16-bit unsigned, so theoretically it could
overflow a 32-bit signed int.
We fix this by making it a 64-bit signed int.
This commit is contained in:
Jacob Boerema 2022-06-03 12:52:17 -04:00
parent 862c54ec94
commit b6d5707816
1 changed files with 2 additions and 1 deletions

View File

@ -393,7 +393,8 @@ fli_read_frame (FILE *f,
}
if (fli_frame.chunks == 0)
{
memcpy (framebuf, old_framebuf, fli_header->width * fli_header->height);
/* Silence a warning: wxh could in theory be more than INT_MAX. */
memcpy (framebuf, old_framebuf, (gint64) fli_header->width * fli_header->height);
}
}
else /* unknown, skip */