lbm: Fail to load images with unsupported/bogus color depth.
authorRyan C. Gordon
Wed, 24 Jan 2018 01:45:04 -0500
changeset 55697f7f01e0665
parent 555 16772bbb1b09
child 557 bfa08dc02b3c
lbm: Fail to load images with unsupported/bogus color depth.
IMG_lbm.c
     1.1 --- a/IMG_lbm.c	Wed Jan 24 01:44:36 2018 -0500
     1.2 +++ b/IMG_lbm.c	Wed Jan 24 01:45:04 2018 -0500
     1.3 @@ -233,6 +233,12 @@
     1.4          nbplanes = 1;
     1.5      }
     1.6  
     1.7 +    if ((nbplanes != 1) && (nbplanes != 4) && (nbplanes != 8) && (nbplanes != 24))
     1.8 +    {
     1.9 +        error="unsupported number of color planes";
    1.10 +        goto done;
    1.11 +    }
    1.12 +
    1.13      stencil = (bmhd.mask & 1);   /* There is a mask ( 'stencil' ) */
    1.14  
    1.15      /* Allocate memory for a temporary buffer ( used for