Skip to content

Commit

Permalink
lbm: Fail to load images with unsupported/bogus color depth.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 24, 2018
1 parent 571c0d7 commit b48777d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions IMG_lbm.c
Expand Up @@ -233,6 +233,12 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
nbplanes = 1;
}

if ((nbplanes != 1) && (nbplanes != 4) && (nbplanes != 8) && (nbplanes != 24))
{
error="unsupported number of color planes";
goto done;
}

stencil = (bmhd.mask & 1); /* There is a mask ( 'stencil' ) */

/* Allocate memory for a temporary buffer ( used for
Expand Down

0 comments on commit b48777d

Please sign in to comment.