check error on header read
This commit is contained in:
parent
d9d2db45b0
commit
449705c0ee
@ -497,8 +497,7 @@ return OLL_KORRECT;
|
|||||||
* que les images RGB. il manque le GRIS !!!
|
* que les images RGB. il manque le GRIS !!!
|
||||||
* ! il manque aussi la decompression !
|
* ! il manque aussi la decompression !
|
||||||
*/
|
*/
|
||||||
Image_Desc *
|
Image_Desc * Image_TGA_alloc_load(char *nom)
|
||||||
Image_TGA_alloc_load(char *nom)
|
|
||||||
{
|
{
|
||||||
Tga_file_header head;
|
Tga_file_header head;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -516,6 +515,11 @@ if ( (fp=fopen(nom, "rb")) == NULL )
|
|||||||
memset(&head, 0, sizeof(Tga_file_header));
|
memset(&head, 0, sizeof(Tga_file_header));
|
||||||
|
|
||||||
foo = Image_TGA_read_header(fp, &head);
|
foo = Image_TGA_read_header(fp, &head);
|
||||||
|
if (foo) {
|
||||||
|
fprintf(stderr, "%s: read error %d on header\n", __func__, foo);
|
||||||
|
fclose(fp);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#if DEBUG_LEVEL > 1
|
#if DEBUG_LEVEL > 1
|
||||||
printf("TGA ALLOC LOAD: read header -> %d\n", foo);
|
printf("TGA ALLOC LOAD: read header -> %d\n", foo);
|
||||||
|
Loading…
Reference in New Issue
Block a user