Commit 16e6a376 authored by Nils Philippsen's avatar Nils Philippsen

Ensure valid bit depths when reading BMP files.

parent f63ba36d
......@@ -399,9 +399,26 @@ ReadBMP (const gchar *name,
}
}
/* Valid bitpdepthis 1, 4, 8, 16, 24, 32 */
/* Valid bit depth is 1, 4, 8, 16, 24, 32 */
/* 16 is awful, we should probably shoot whoever invented it */
switch (Bitmap_Head.biBitCnt)
{
case 1:
case 2:
case 4:
case 8:
case 16:
case 24:
case 32:
break;
default:
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
/* There should be some colors used! */
ColormapSize =
......
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