IMG_xcf.c
changeset 419 e108e1228d62
parent 415 1700d607fce3
child 451 48116d511e5d
     1.1 --- a/IMG_xcf.c	Wed Jul 31 21:45:15 2013 -0700
     1.2 +++ b/IMG_xcf.c	Wed Aug 07 09:18:35 2013 -0700
     1.3 @@ -289,7 +289,7 @@
     1.4    if (h->cm_num)
     1.5      SDL_free (h->cm_map);
     1.6    if (h->layer_file_offsets)
     1.7 -	  SDL_free (h->layer_file_offsets);
     1.8 +    SDL_free (h->layer_file_offsets);
     1.9    SDL_free (h);
    1.10  }
    1.11  
    1.12 @@ -625,6 +625,15 @@
    1.13          break;
    1.14        default:
    1.15          fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
    1.16 +        if (hierarchy)
    1.17 +        {
    1.18 +          if (hierarchy->level_file_offsets)
    1.19 +            SDL_free(hierarchy->level_file_offsets);
    1.20 +         
    1.21 +          free_xcf_hierarchy(hierarchy);
    1.22 +        }
    1.23 +        if (level)     
    1.24 +          free_xcf_level (level);
    1.25          return 1;
    1.26        }
    1.27        break;
    1.28 @@ -650,6 +659,12 @@
    1.29          break;
    1.30        default:
    1.31          fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
    1.32 +        if (tile)
    1.33 +          free_xcf_tile (tile);
    1.34 +        if (level)
    1.35 +          free_xcf_level (level);
    1.36 +        if (hierarchy)
    1.37 +          free_xcf_hierarchy (hierarchy);
    1.38          return 1;
    1.39        }
    1.40        break;