[Commits] SDL_image: lbm: Fail to load images with unsupported/bogus color...

libsdl.org revision control commits-owner at libsdl.org
Tue Jan 23 22:55:00 PST 2018


details:   https://hg.libsdl.org/SDL_image/rev/97f7f01e0665
changeset: 556:97f7f01e0665
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Wed Jan 24 01:45:04 2018 -0500
description:
lbm: Fail to load images with unsupported/bogus color depth.

diffstat:

 IMG_lbm.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

diff -r 16772bbb1b09 -r 97f7f01e0665 IMG_lbm.c
--- a/IMG_lbm.c	Wed Jan 24 01:44:36 2018 -0500
+++ b/IMG_lbm.c	Wed Jan 24 01:45:04 2018 -0500
@@ -233,6 +233,12 @@
         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


More information about the commits mailing list