[FFmpeg-cvslog] avcodec/h264: Free rbsp_buffer before copying context over it

Michael Niedermayer git at videolan.org
Sun Aug 25 03:41:21 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 25 03:15:26 2013 +0200| [626739ebbb76b14b03c9946c192570938f5e2494] | committer: Michael Niedermayer

avcodec/h264: Free rbsp_buffer before copying context over it

Fixes memleak
Fixes Ticket1900

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

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d328610..1d069a8 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1767,6 +1767,8 @@ static int decode_update_thread_context(AVCodecContext *dst,
         for (i = 0; i < MAX_PPS_COUNT; i++)
             av_freep(h->pps_buffers + i);
 
+        av_freep(&h->rbsp_buffer[0]);
+        av_freep(&h->rbsp_buffer[1]);
         memcpy(h, h1, offsetof(H264Context, intra_pcm_ptr));
         memcpy(&h->cabac, &h1->cabac,
                sizeof(H264Context) - offsetof(H264Context, cabac));



More information about the ffmpeg-cvslog mailing list