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

version» Context lines:

pike.git/src/modules/Image/encodings/wbf.c:64:    int header;    int fix_header_field;    int ext_header_field;    struct ext_header *first_ext_header;   };      static void read_string( struct buffer *from, unsigned int len, char *to )   {    if( from->len < len )    Pike_error("Invalid data format\n"); -  MEMCPY( from->str, to, len ); +  memcpy( from->str, to, len );    from->str += len;    from->len -= len;   }      static unsigned char read_uchar( struct buffer *from )   {    unsigned char res = 0;    if(from->len)    {    res = from->str[0];
pike.git/src/modules/Image/encodings/wbf.c:119:    struct ext_header *eh = wh->first_ext_header;    wh->first_ext_header = eh->next;    free( eh );    }   }      static struct wbf_header decode_header( struct buffer *data )   {    struct wbf_header res;    ONERROR err; -  MEMSET( &res, 0, sizeof(res) ); +  memset( &res, 0, sizeof(res) );    res.type = wbf_read_int( data );    res.fix_header_field = read_uchar( data );    SET_ONERROR(err, free_wbf_header_contents, &res);       if( res.fix_header_field & 0x80 )    {    switch( (res.fix_header_field>>5) & 0x3 )    {    case 0: /* Single varint extra header */    res.ext_header_field = wbf_read_int( data );