diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 8f5d58d10e..d267faa6a1 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1218,6 +1218,8 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, h->got_keyframe = 1; } case PIC_PB_START_CODE: + if (*got_frame) + av_frame_unref(data); *got_frame = 0; if (!h->got_keyframe) break;