Skip to content

Commit

Permalink
bugfix: added error reporting on invalid BMP bpp value; this fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Szabo committed Feb 27, 2018
1 parent b18d7b7 commit 4737871
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions input-bmp.ci
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ bitmap_type bmp_load_image (at_string filename)

if (Maps != 3 && Maps != 4) FATALP("BMP: Bad color_size.");

switch (Bitmap_Head.biBitCnt) {
case 32: case 24: case 16: case 8: case 4: case 2: case 1: break;
default:
FATALP ("BMP: Invalid bpp.");
}

/* Valid options 1, 4, 8, 16, 24, 32 */
/* 16 is awful, we should probably shoot whoever invented it */

Expand Down

0 comments on commit 4737871

Please sign in to comment.