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

version» Context lines:

pike.git/src/modules/Image/encodings/wbf.c:1:   /*   || 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: wbf.c,v 1.15 2004/03/06 00:07:00 nilsson Exp $ + || $Id: wbf.c,v 1.16 2004/05/19 00:08:01 nilsson Exp $   */      #include "global.h"      #include <math.h>   #include <stdio.h>   #include <ctype.h>      #include "stralloc.h" - RCSID("$Id: wbf.c,v 1.15 2004/03/06 00:07:00 nilsson Exp $"); + RCSID("$Id: wbf.c,v 1.16 2004/05/19 00:08:01 nilsson Exp $");   #include "object.h"   #include "mapping.h"   #include "interpret.h"   #include "operators.h"   #include "svalue.h"   #include "pike_error.h"   #include "builtin_functions.h"   #include "program.h"      #include "image.h"
pike.git/src/modules/Image/encodings/wbf.c:125:    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 = malloc( sizeof( struct ext_header ) ); +  eh = xalloc( sizeof( struct ext_header ) );    MEMSET( eh, 0, sizeof( struct ext_header ) );    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 );    eh->next = res.first_ext_header;    res.first_ext_header = eh->next;    }    }    }
pike.git/src/modules/Image/encodings/wbf.c:353:    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 = malloc( i->ysize * (i->xsize+7)/8 ); +  data = xalloc( i->ysize * (i->xsize+7)/8 );    MEMSET( data, 0, 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++;