Commit 0214e1ff authored by Nils Philippsen's avatar Nils Philippsen

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.
(cherry picked from commit 43d57c66)
parent f05ea433
......@@ -424,8 +424,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"),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment