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

version» Context lines:

pike.git/src/modules/Image/encodings/xcf.c:509:    MEMSET(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );       SET_ONERROR( err, free_level, &res );    offset = read_uint( buff );    while(offset)    {    struct buffer ob = *initial;    int offset2 = read_uint( buff ); -  struct tile *tile = (struct tile *)xalloc(sizeof(struct tile)); +  struct tile *tile = xalloc(sizeof(struct tile));    read_data( &ob, offset );    if(last_tile)    last_tile->next = tile;    last_tile = tile;    if(!res.first_tile)    res.first_tile = tile;    tile->data = ob;    tile->next = NULL;    offset = offset2;    }
pike.git/src/modules/Image/encodings/xcf.c:561:    res.width = read_uint( buff );    res.height = read_uint( buff );    res.name = read_string( buff );       SET_ONERROR( err, free_layer_mask, &res );    do    {    tmp = read_property( buff );    if(tmp.type)    { -  struct property *s = (struct property *)xalloc(sizeof(struct property)); +  struct property *s = xalloc(sizeof(struct property));    *s = tmp;    s->next = res.first_property;    res.first_property = s;    }    } while(tmp.type);    offset = read_uint( buff );       if(offset)    {    struct buffer ob = *initial;
pike.git/src/modules/Image/encodings/xcf.c:598:    res.width = read_uint( buff );    res.height = read_uint( buff );    res.name = read_string( buff );       SET_ONERROR( err, free_channel, &res );    do    {    tmp = read_property( buff );    if(tmp.type)    { -  struct property *s =(struct property *)xalloc( sizeof(struct property )); +  struct property *s = xalloc( sizeof(struct property ));    *s = tmp;    s->next = res.first_property;    res.first_property = s;    }    } while( tmp.type );    offset = read_uint( buff );       if(offset)    {    struct buffer ob = *initial;
pike.git/src/modules/Image/encodings/xcf.c:637:    res.height = read_uint( buff );    res.type = xcf_read_int( buff );    res.name = read_string( buff );          do    {    tmp = read_property( buff );    if(tmp.type)    { -  struct property *s=(struct property *)xalloc( sizeof(struct property )); +  struct property *s=xalloc( sizeof(struct property ));    *s = tmp;    s->next = res.first_property;    res.first_property = s;    }    } while( tmp.type );       h_offset = xcf_read_int( buff );    lm_offset = xcf_read_int( buff );       if(lm_offset)    {    struct buffer loffset = *initial; -  struct layer_mask *m=(struct layer_mask *)xalloc(sizeof(struct layer_mask)); +  struct layer_mask *m=xalloc(sizeof(struct layer_mask));    res.mask = m;    read_data( &loffset, lm_offset );    MEMSET(m, 0, sizeof( struct layer_mask ));    *m = read_layer_mask( &loffset, initial );    }       if(h_offset)    {    struct buffer loffset = *initial;    read_data( &loffset, h_offset );
pike.git/src/modules/Image/encodings/xcf.c:705:    res.height = read_uint( data );    res.type = xcf_read_int( data );       SET_ONERROR( err, free_image, &res );       do    {    tmp = read_property( data );    if(tmp.type)    { -  struct property *s= (struct property *)xalloc( sizeof(struct property )); +  struct property *s=xalloc( sizeof(struct property ));    *s = tmp;    s->next = res.first_property;    res.first_property = s;    }    } while( tmp.type );       while( (offset = read_uint( data )) )    {    struct buffer layer_data = initial;    struct layer tmp;    read_data( &layer_data, offset );    tmp = read_layer( &layer_data, &initial );    if( tmp.width && tmp.height )    { -  struct layer *s = (struct layer *)xalloc( sizeof(struct layer)); +  struct layer *s = xalloc( sizeof(struct layer));    *s = tmp;    s->next = res.first_layer;    res.first_layer = s;    }    }       while( (offset = read_uint( data )) )    {    struct buffer channel_data = initial;    struct channel tmp;    read_data( &channel_data, offset );    tmp = read_channel( &channel_data, &initial );    if( tmp.width && tmp.height )    { -  struct channel *s = (struct channel *)xalloc( sizeof(struct channel)); +  struct channel *s = xalloc( sizeof(struct channel));    *s = tmp;    s->next = res.first_channel;    res.first_channel = s;    }    }    UNSET_ONERROR( err );    return res;   }      static void push_buffer( struct buffer *b )
pike.git/src/modules/Image/encodings/xcf.c:1232:    eheight = MINIMUM(TILE_HEIGHT, (rys-y));       if( (double)ewidth * eheight * bpp > INT_MAX )    Pike_error("Insanely large tiles not supported\n");    if(rle)    {    struct buffer s = tile, od, d;    int i;    od.s = NULL;    od.len = eheight*ewidth*bpp; /* Max and only size, really */ -  df = (char *)(od.str = (unsigned char *)xalloc( eheight*ewidth*bpp+1 )); +  df = (char *)(od.str = xalloc( eheight*ewidth*bpp+1 ));    d = od;       for(i=0; i<bpp; i++)    {    int nelems = ewidth*eheight;    int length;    while(nelems)    {    unsigned char val = read_char( &s );    if(!s.len)