diff --git a/plug-ins/file-bmp/bmp-read.c b/plug-ins/file-bmp/bmp-read.c index cc3b7e846a..4fa415fdef 100644 --- a/plug-ins/file-bmp/bmp-read.c +++ b/plug-ins/file-bmp/bmp-read.c @@ -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"),