From 72f1701c92f7f021d00c57f4f928efa719fcd53d Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Thu, 20 Oct 2016 22:14:22 +0200 Subject: [PATCH] cavsdec: unref frame before referencing again This fixes asserts (from commit 13aae8) in av_frame_ref and av_frame_move_ref. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 1966ea012fd72abc8003e95dc3c8ad9e9f197913) Signed-off-by: Andreas Cadhalpun --- libavcodec/cavsdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 70ac6f8a42..fed7043c12 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1217,6 +1217,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;