From 5c382891df475f17b84865093d85f296fac577f1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 21 Feb 2003 17:24:03 +0000 Subject: [PATCH] *** empty log message *** --- IMG_xcf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/IMG_xcf.c b/IMG_xcf.c index 10fbc317..aa41e10b 100644 --- a/IMG_xcf.c +++ b/IMG_xcf.c @@ -678,15 +678,15 @@ SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) { unsigned char * (* load_tile) (SDL_RWops *, Uint32, int, int, int); - /* Initialize the data we will clean up when we're done */ - surface = NULL; - read_error = 0; - /* Check to make sure we have something to do */ if ( ! src ) { - goto done; + return NULL; } + /* Initialize the data we will clean up when we're done */ + surface = NULL; + read_error = 0; + head = read_xcf_header (src); switch (head->compr) { @@ -714,7 +714,7 @@ SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) { head->layer_file_offsets = NULL; offsets = 0; - while (offset = SDL_ReadBE32 (src)) { + while ((offset = SDL_ReadBE32 (src))) { head->layer_file_offsets = (Uint32 *) realloc (head->layer_file_offsets, sizeof (Uint32) * (offsets+1)); head->layer_file_offsets [offsets] = offset; offsets++; @@ -757,7 +757,7 @@ SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) { // read channels channel = NULL; chnls = 0; - while (offset = SDL_ReadBE32 (src)) { + while ((offset = SDL_ReadBE32 (src))) { channel = (xcf_channel **) realloc (channel, sizeof (xcf_channel *) * (chnls+1)); fp = SDL_RWtell (src); SDL_RWseek (src, offset, SEEK_SET);