mirror of https://github.com/GNOME/gimp.git
Make plausibility check easier to understand.
Explicitly check that Bitmap_Head.biHeight is not G_MININT32 instead of relying on ABS(G_MININT32) being negative.
This commit is contained in:
parent
7810dede39
commit
43d57c6663
|
@ -423,8 +423,10 @@ ReadBMP (const gchar *name,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* biHeight may be negative, but G_MININT32 is dangerous because:
|
||||
G_MININT32 == -(G_MININT32) */
|
||||
if (Bitmap_Head.biWidth < 0 ||
|
||||
ABS (Bitmap_Head.biHeight) < 0)
|
||||
Bitmap_Head.biHeight == G_MININT32)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("'%s' is not a valid BMP file"),
|
||||
|
|
Loading…
Reference in New Issue