]> git.imager.perl.org - imager.git/commitdiff
make the targa probe even stricter
authorTony Cook <tony@develop=help.com>
Fri, 24 Mar 2006 04:26:24 +0000 (04:26 +0000)
committerTony Cook <tony@develop=help.com>
Fri, 24 Mar 2006 04:26:24 +0000 (04:26 +0000)
tga.c

diff --git a/tga.c b/tga.c
index 0326119717b7defec624bfbe7c72bd5356327bdd..b26081091b26811f41e6631d410f7d40a161bd8e 100644 (file)
--- a/tga.c
+++ b/tga.c
@@ -339,7 +339,10 @@ tga_header_verify(unsigned char headbuf[18]) {
   case 0:
   case 2:  /* Uncompressed, rgb images          */ 
   case 10: /* Compressed,   rgb images          */ 
-         break;
+    if (header.bitsperpixel != 15 && header.bitsperpixel != 16
+       && header.bitsperpixel != 24 && header.bitsperpixel != 23)
+      return 0;
+    break;
        }
 
   switch (header.colourmaptype) {