Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/imlib2

Dir     : e17/libs/imlib2/loaders


Modified Files:
        loader_tga.c 


Log Message:


handle files too small to be a valid tga!

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/imlib2/loaders/loader_tga.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- loader_tga.c        27 Apr 2004 10:15:38 -0000      1.9
+++ loader_tga.c        20 May 2004 03:34:27 -0000      1.10
@@ -236,6 +236,11 @@
         return 0;
      }
 
+   if (ss.st_size < sizeof(tga_header) + sizeof(tga_footer))
+     {
+        close(fd);
+        return 0;
+     }
    seg = mmap(0, ss.st_size, PROT_READ, MAP_SHARED, fd, 0);
    if (seg == MAP_FAILED)
      {




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to