forked from old/legacy-imlib2
handle files too small to be a valid tga!
SVN revision: 10288
This commit is contained in:
parent
8ca824db74
commit
aff90a588d
|
@ -236,6 +236,11 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue