aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-20 22:14:22 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-21 19:41:15 +0200
commit1966ea012fd72abc8003e95dc3c8ad9e9f197913 (patch)
treebd6a624293d2647ff5662bebc025c2061e452db8
parentb0a043f51b8cc3b420dc3ceaa38fe9aa344799aa (diff)
downloadffmpeg-1966ea012fd72abc8003e95dc3c8ad9e9f197913.tar.gz
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 <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/cavsdec.c2
1 files changed, 2 insertions, 0 deletions
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;