[FFmpeg-cvslog] avcodec/utils: Fix leak by dereferencing audio frame when side data causes whole frame skip

Matt Wolenetz git at videolan.org
Tue May 7 01:34:09 CEST 2013


ffmpeg | branch: master | Matt Wolenetz <wolenetz at chromium.org> | Mon May  6 14:44:17 2013 -0700| [004779cc59ae6b649e20aa260cd4a4d2e1f4bc48] | committer: Michael Niedermayer

avcodec/utils: Fix leak by dereferencing audio frame when side data causes whole frame skip

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=004779cc59ae6b649e20aa260cd4a4d2e1f4bc48
---

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 4136d9f..f4aeb19 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 {



More information about the ffmpeg-cvslog mailing list