diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index 96f40a1bd0..b06ea7a5b2 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -511,8 +511,14 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, s->modelp = &s->models[is_alpha]; res = s->parse_header(s, buf, remaining_buf_size, &golden_frame); - if (res < 0) + if (res < 0) { + int i; + for (i = 0; i < 4; i++) { + if (s->frames[i].data[0]) + avctx->release_buffer(avctx, &s->frames[i]); + } return res; + } if (res == VP56_SIZE_CHANGE) { int i;