X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fpcx.c;h=b26e44274c4c99d8f7dbfa18857cf5bedd20af6b;hp=cb8e54980fdc1490b8fb09d9c624bb3928367aaf;hb=8d46c5298f0fcce7bdb52f3835b2fbbdc403dfe0;hpb=8555e08bda91e309c9878785a5aef82ca3497394 diff --git a/src/pcx.c b/src/pcx.c index cb8e5498..b26e4427 100644 --- a/src/pcx.c +++ b/src/pcx.c @@ -154,6 +154,7 @@ Image *Read_PCX_to_Image(char *filename) { /* PCX file is too short to contain a valid PCX header */ fclose(file); + errno_pcx = PCX_FileInvalid; return NULL; } @@ -190,6 +191,7 @@ Image *Read_PCX_to_Image(char *filename) width < 0 || height < 0) { free(file_buffer); + errno_pcx = PCX_FileInvalid; return NULL; } @@ -198,7 +200,7 @@ Image *Read_PCX_to_Image(char *filename) if (options.verbose) { printf("%s is a %dx%d PC Paintbrush image with %d bitplanes\n", - filename, pcx.xmax, pcx.ymax, + filename, width, height, pcx.color_planes); printf("depth: %d\n", pcx.bits_per_pixel); printf("color_planes: %d\n", pcx.color_planes); @@ -220,6 +222,7 @@ Image *Read_PCX_to_Image(char *filename) { free(file_buffer); freeImage(image); + errno_pcx = PCX_FileInvalid; return NULL; }