diff --git a/Lib/tga.c b/Lib/tga.c index 9a89738..97603d7 100644 --- a/Lib/tga.c +++ b/Lib/tga.c @@ -497,8 +497,7 @@ return OLL_KORRECT; * que les images RGB. il manque le GRIS !!! * ! il manque aussi la decompression ! */ -Image_Desc * -Image_TGA_alloc_load(char *nom) +Image_Desc * Image_TGA_alloc_load(char *nom) { Tga_file_header head; FILE *fp; @@ -516,6 +515,11 @@ if ( (fp=fopen(nom, "rb")) == NULL ) memset(&head, 0, sizeof(Tga_file_header)); 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 printf("TGA ALLOC LOAD: read header -> %d\n", foo);