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

version» Context lines:

pike.git/src/modules/Image/encodings/wbf.c:136:    case 1: /* reserved */    case 2: /* reserved */    case 3: /* Array of parameter/value */    {    int q = 0x80;       while( q & 0x80 )    {    struct ext_header *eh;    q = read_uchar( data ); -  eh = xalloc( sizeof( struct ext_header ) ); -  MEMSET( eh, 0, sizeof( struct ext_header ) ); +  eh = xcalloc( 1, sizeof( struct ext_header ) );    eh->next = res.first_ext_header;    res.first_ext_header = eh;    eh->name_len = ((q>>4) & 0x7) + 1;    eh->value_len = (q & 0xf) + 1;    read_string( data, eh->name_len, eh->name );    read_string( data, eh->value_len, eh->value );    }    }    }    }
pike.git/src/modules/Image/encodings/wbf.c:354:    data[0] &= 0x7f;    push_string( make_shared_binary_string( data, pos ) );    f_reverse(1);   }      static void push_wap_type0_image_data( struct image *i )   {    int x, y;    unsigned char *data, *p;    rgb_group *is; -  data = xalloc( i->ysize * (i->xsize+7)/8 ); -  MEMSET( data, 0, i->ysize * (i->xsize+7)/8 ); +  data = xcalloc( i->ysize, (i->xsize+7)/8 );    is = i->img;    for( y = 0; y<i->ysize; y++ )    {    p = data + (i->xsize+7)/8*y;    for( x = 0; x<i->xsize; x++ )    {    if( is->r || is->g || is->b )    p[x/8] |= 128 >> (x%8);    is++;    }