Revision 0080402d libavcodec/xan.c

View differences:

libavcodec/xan.c
76 76

  
77 77
    s->buffer1_size = avctx->width * avctx->height;
78 78
    s->buffer1 = av_malloc(s->buffer1_size);
79
    if (!s->buffer1)
80
        return -1;
79 81
    s->buffer2_size = avctx->width * avctx->height;
80 82
    s->buffer2 = av_malloc(s->buffer2_size + 130);
81
    if (!s->buffer1 || !s->buffer2)
83
    if (!s->buffer2) {
84
        av_freep(&s->buffer1);
82 85
        return -1;
86
    }
83 87

  
84 88
    return 0;
85 89
}
......
405 409
    if (s->current_frame.data[0])
406 410
        avctx->release_buffer(avctx, &s->current_frame);
407 411

  
408
    av_free(s->buffer1);
409
    av_free(s->buffer2);
412
    av_freep(&s->buffer1);
413
    av_freep(&s->buffer2);
410 414

  
411 415
    return 0;
412 416
}

Also available in: Unified diff