IMG_xcf.c
changeset 419 e108e1228d62
parent 415 1700d607fce3
child 451 48116d511e5d
equal deleted inserted replaced
418:40798dcfe7f2 419:e108e1228d62
   287 
   287 
   288 static void free_xcf_header (xcf_header * h) {
   288 static void free_xcf_header (xcf_header * h) {
   289   if (h->cm_num)
   289   if (h->cm_num)
   290     SDL_free (h->cm_map);
   290     SDL_free (h->cm_map);
   291   if (h->layer_file_offsets)
   291   if (h->layer_file_offsets)
   292 	  SDL_free (h->layer_file_offsets);
   292     SDL_free (h->layer_file_offsets);
   293   SDL_free (h);
   293   SDL_free (h);
   294 }
   294 }
   295 
   295 
   296 static xcf_header * read_xcf_header (SDL_RWops * src) {
   296 static xcf_header * read_xcf_header (SDL_RWops * src) {
   297   xcf_header * h;
   297   xcf_header * h;
   623           row++;
   623           row++;
   624         }
   624         }
   625         break;
   625         break;
   626       default:
   626       default:
   627         fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
   627         fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
       
   628         if (hierarchy)
       
   629         {
       
   630           if (hierarchy->level_file_offsets)
       
   631             SDL_free(hierarchy->level_file_offsets);
       
   632          
       
   633           free_xcf_hierarchy(hierarchy);
       
   634         }
       
   635         if (level)     
       
   636           free_xcf_level (level);
   628         return 1;
   637         return 1;
   629       }
   638       }
   630       break;
   639       break;
   631     case 1: // Indexed/Greyscale
   640     case 1: // Indexed/Greyscale
   632       switch (head->image_type) {
   641       switch (head->image_type) {
   648             ++p8;
   657             ++p8;
   649         }
   658         }
   650         break;
   659         break;
   651       default:
   660       default:
   652         fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
   661         fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type);
       
   662         if (tile)
       
   663           free_xcf_tile (tile);
       
   664         if (level)
       
   665           free_xcf_level (level);
       
   666         if (hierarchy)
       
   667           free_xcf_hierarchy (hierarchy);
   653         return 1;
   668         return 1;
   654       }
   669       }
   655       break;
   670       break;
   656     }
   671     }
   657       }
   672       }