Revision 16c83185 libavcodec/indeo3.c

View differences:

libavcodec/indeo3.c
107 107
    unsigned int bufsize = luma_pixels * 2 + luma_width * 3 +
108 108
                          (chroma_pixels   + chroma_width) * 4;
109 109

  
110
    av_freep(&s->buf);
110 111
    if(!(s->buf = av_malloc(bufsize)))
111 112
        return AVERROR(ENOMEM);
112 113
    s->iv_frame[0].y_w = s->iv_frame[1].y_w = luma_width;
......
997 998

  
998 999
    if(avcodec_check_dimensions(avctx, image_width, image_height))
999 1000
        return -1;
1001
    if (image_width != avctx->width || image_height != avctx->height) {
1002
        int ret;
1003
        avcodec_set_dimensions(avctx, image_width, image_height);
1004
        s->width  = avctx->width;
1005
        s->height = avctx->height;
1006
        ret = iv_alloc_frames(s);
1007
        if (ret < 0) {
1008
            s->width = s->height = 0;
1009
            return ret;
1010
        }
1011
    }
1000 1012

  
1001 1013
    chroma_height = ((image_height >> 2) + 3) & 0x7ffc;
1002 1014
    chroma_width = ((image_width >> 2) + 3) & 0x7ffc;

Also available in: Unified diff