Revision 6fe68c7b libavcodec/faxcompr.c

View differences:

libavcodec/faxcompr.c
280 280
    GetBitContext gb;
281 281
    int *runs, *ref, *runend;
282 282
    int ret;
283
    int runsize= avctx->width + 2;
283 284

  
284
    runs = av_malloc((avctx->width + 2) * sizeof(runs[0]));
285
    ref  = av_malloc((avctx->width + 2) * sizeof(ref[0]));
285
    runs = av_malloc(runsize * sizeof(runs[0]));
286
    ref  = av_malloc(runsize * sizeof(ref[0]));
286 287
    ref[0] = avctx->width;
287 288
    ref[1] = 0;
288 289
    ref[2] = 0;
289 290
    init_get_bits(&gb, src, srcsize*8);
290 291
    for(j = 0; j < height; j++){
291
        runend = runs + avctx->width + 2;
292
        runend = runs + runsize;
292 293
        if(compr == TIFF_G4){
293 294
            ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
294 295
            if(ret < 0){

Also available in: Unified diff