summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMatt Wolenetz <wolenetz@chromium.org>2013-05-06 14:44:17 -0700
committerMichael Niedermayer <michaelni@gmx.at>2013-05-07 01:33:08 +0200
commit004779cc59ae6b649e20aa260cd4a4d2e1f4bc48 (patch)
tree1b79205af102a1bc43e39d8804d7fe7f422e6d84 /libavcodec
parent974420a701c78508a7e7f91ec8179b595e7b98f5 (diff)
avcodec/utils: Fix leak by dereferencing audio frame when side data causes whole frame skip
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 4136d9fda2..f4aeb19aef 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2104,6 +2104,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
if(frame->nb_samples <= avctx->internal->skip_samples){
*got_frame_ptr = 0;
avctx->internal->skip_samples -= frame->nb_samples;
+ if (avctx->refcounted_frames)
+ av_frame_unref(frame);
av_log(avctx, AV_LOG_DEBUG, "skip whole frame, skip left: %d\n",
avctx->internal->skip_samples);
} else {