Revision 0c9afacb

View differences:

libavcodec/vp3.c
1889 1889

  
1890 1890
    /* release the last frame, if it is allocated and if it is not the
1891 1891
     * golden frame */
1892
    if ((s->last_frame.data[0]) &&
1893
        (s->last_frame.data[0] != s->golden_frame.data[0]))
1892
    if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY)
1894 1893
        avctx->release_buffer(avctx, &s->last_frame);
1895 1894

  
1896 1895
    /* shuffle frames (last = current) */
......
1900 1899
        if (s->golden_frame.data[0])
1901 1900
            avctx->release_buffer(avctx, &s->golden_frame);
1902 1901
        s->golden_frame = s->current_frame;
1902
        s->last_frame.type = FF_BUFFER_TYPE_COPY;
1903 1903
    }
1904 1904

  
1905 1905
    s->current_frame.data[0]= NULL; /* ensure that we catch any access to this released frame */
......
1941 1941
    free_vlc(&s->motion_vector_vlc);
1942 1942

  
1943 1943
    /* release all frames */
1944
    if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0])
1944
    if (s->golden_frame.data[0])
1945 1945
        avctx->release_buffer(avctx, &s->golden_frame);
1946
    if (s->last_frame.data[0])
1946
    if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY)
1947 1947
        avctx->release_buffer(avctx, &s->last_frame);
1948 1948
    /* no need to release the current_frame since it will always be pointing
1949 1949
     * to the same frame as either the golden or last frame */

Also available in: Unified diff