pike.git / src / modules / Image / encodings / xcf.c

version» Context lines:

pike.git/src/modules/Image/encodings/xcf.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: xcf.c,v 1.48 2004/03/06 00:07:00 nilsson Exp $ + || $Id: xcf.c,v 1.49 2004/05/19 00:08:02 nilsson Exp $   */      #include "global.h" - RCSID("$Id: xcf.c,v 1.48 2004/03/06 00:07:00 nilsson Exp $"); + RCSID("$Id: xcf.c,v 1.49 2004/05/19 00:08:02 nilsson Exp $");      #include "image_machine.h"      #include "pike_macros.h"   #include "object.h"   #include "module_support.h"   #include "interpret.h"   #include "object.h"   #include "svalue.h"   #include "threads.h"
pike.git/src/modules/Image/encodings/xcf.c:1185:    struct array *tiles;    struct image *i=NULL, *a=NULL;    struct neo_colortable *cmap = NULL;    INT32 rxs, rys;    rgb_group *colortable=NULL;    rgb_group pix = {0,0,0};    rgb_group apix= {255,255,255}; /* avoid may use uninitialized warnings */       INT_TYPE rle, bpp, span, shrink;    unsigned int l, x=0, y=0, cx, cy; +  ONERROR err;    get_all_args( "_decode_tiles", args, "%o%O%a%i%i%O%i%d%d",    &io, &ao, &tiles, &rle, &bpp, &cmapo, &shrink, &rxs, &rys);          if( !(i = (struct image *)get_storage( io, image_program )))    Pike_error("Wrong type object argument 1 (image)\n");       if(ao && !(a = (struct image *)get_storage( ao, image_program )))    Pike_error("Wrong type object argument 2 (image)\n");   
pike.git/src/modules/Image/encodings/xcf.c:1209:       for(l=0; l<(unsigned int)tiles->size; l++)    if(tiles->item[l].type != T_OBJECT)    Pike_error("Wrong type array argument 3 (tiles)\n");       if(a && ((i->xsize != a->xsize) || (i->ysize != a->ysize)))    Pike_error("Image and alpha objects are not identically sized.\n");       if(cmap)    { -  colortable = malloc(sizeof(rgb_group)*image_colortable_size( cmap )); +  colortable = xalloc(sizeof(rgb_group)*image_colortable_size( cmap )); +  SET_ONERROR(err, free, colortable);    image_colortable_write_rgb( cmap, (unsigned char *)colortable );    }       x=y=0;       THREADS_ALLOW();    for(l=0; l<(unsigned)tiles->size; l++)    {    struct object *to = tiles->item[l].u.object;    struct substring *tile_ss = SS(to);
pike.git/src/modules/Image/encodings/xcf.c:1396:    }    x += TILE_WIDTH;       if( (int)x >= (int)rxs )    {    x = 0;    y += TILE_HEIGHT;    }    }    THREADS_DISALLOW(); -  if(colortable) +  if(colortable) { +  UNSET_ONERROR(err);    free( colortable ); -  +  }       pop_n_elems(args);    push_int(0);   }         static struct program *image_encoding_xcf_program=NULL;   void init_image_xcf()   {    add_function( "___decode", image_xcf____decode,