Branch: Tag:

2004-05-19

2004-05-19 00:10:11 by Martin Nilsson <mani@lysator.liu.se>

Some malloc fixes

Rev: src/modules/Image/blit.c:1.57
Rev: src/modules/Image/colortable.c:1.120
Rev: src/modules/Image/dct.c:1.27
Rev: src/modules/Image/encodings/atari.c:1.4
Rev: src/modules/Image/encodings/atari.h:1.4
Rev: src/modules/Image/encodings/neo.c:1.10
Rev: src/modules/Image/encodings/pcx.c:1.22
Rev: src/modules/Image/encodings/png.c:1.64
Rev: src/modules/Image/encodings/tga.c:1.36
Rev: src/modules/Image/encodings/wbf.c:1.16
Rev: src/modules/Image/encodings/x.c:1.46
Rev: src/modules/Image/encodings/xcf.c:1.49
Rev: src/modules/Image/font.c:1.84
Rev: src/modules/Image/image.c:1.215
Rev: src/modules/Image/matrix.c:1.49
Rev: src/modules/Image/pattern.c:1.30
Rev: src/modules/Image/polyfill.c:1.49
Rev: src/modules/Image/search.c:1.29

2:   || 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"   
1192:       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);   
1216:       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 );    }   
1403:    }    }    THREADS_DISALLOW(); -  if(colortable) +  if(colortable) { +  UNSET_ONERROR(err);    free( colortable ); -  +  }       pop_n_elems(args);    push_int(0);