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 0326119..b260810 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) {