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

version» Context lines:

pike.git/src/modules/Image/encodings/xcf.c:506:   }      static struct level read_level( struct buffer *buff,    struct buffer *initial )   {    struct level res;    ONERROR err;    int offset;    struct tile *last_tile = NULL;   /* int all_tiles_eq = 0; */ -  MEMSET(&res, 0, sizeof(res)); +  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 = xalloc(sizeof(struct tile));
pike.git/src/modules/Image/encodings/xcf.c:538:    return res;   }      static struct hierarchy read_hierarchy( struct buffer *buff,    struct buffer *initial )   {    struct hierarchy res;    unsigned int offset;    struct buffer ob;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );    res.bpp = read_uint( buff );    offset = read_uint( buff );    ob = *initial;    read_data( &ob, offset );    res.level = read_level( &ob, initial );    return res;   }      static struct layer_mask read_layer_mask( struct buffer *buff,    struct buffer *initial )   {    struct layer_mask res;    ONERROR err;    int offset;    struct property tmp;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    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)    {
pike.git/src/modules/Image/encodings/xcf.c:594:   }      static struct channel read_channel( struct buffer *buff,    struct buffer *initial )   {    struct channel res;    ONERROR err;    int offset;    struct property tmp;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    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)    {
pike.git/src/modules/Image/encodings/xcf.c:631:   }      static struct layer read_layer( struct buffer *buff, struct buffer *initial )   {    struct layer res;    struct property tmp;    int lm_offset;    int h_offset;    ONERROR err;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    SET_ONERROR( err, free_layer, &res );    res.width = read_uint( buff );    res.height = read_uint( buff );    res.type = xcf_read_int( buff );    res.name = read_string( buff );          do    {    tmp = read_property( buff );
pike.git/src/modules/Image/encodings/xcf.c:660:       h_offset = xcf_read_int( buff );    lm_offset = xcf_read_int( buff );       if(lm_offset)    {    struct buffer loffset = *initial;    struct layer_mask *m=xalloc(sizeof(struct layer_mask));    res.mask = m;    read_data( &loffset, lm_offset ); -  MEMSET(m, 0, sizeof( struct layer_mask )); +  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 );    res.image_data = read_hierarchy( &loffset, initial );    }   
pike.git/src/modules/Image/encodings/xcf.c:684:         static struct gimp_image read_image( struct buffer * data )   {    struct gimp_image res;    struct property tmp;    struct buffer initial;    unsigned int offset;    ONERROR err;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    initial = *data;    if(data->len < 34)    Pike_error("This is not an xcf file (to little data)\n");    if(!(data->str[0] == 'g' &&    data->str[1] == 'i' &&    data->str[2] == 'm' &&    data->str[3] == 'p' &&    data->str[4] == ' '))    {    if(strlen((char *)data->str) == 13)