[FFmpeg-devel] [PATCH] h264: unref leaking error recovery picture

wm4 nfxjfg at googlemail.com
Mon Jan 19 17:14:44 CET 2015


This leaked a frame on each avcodec_flush_buffers() call, if frame
threading was enabled. It caused severe memory usage in player if you
were seeking a lot.
---
Regression since 855463c007719d8a9cddfa757a00ae5428b3dbde
---
 libavcodec/h264_slice.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index ae50b9a..3874d07 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -529,6 +529,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
 
         av_freep(&h->rbsp_buffer[0]);
         av_freep(&h->rbsp_buffer[1]);
+        ff_h264_unref_picture(h, &h->last_pic_for_ec);
         memcpy(h, h1, offsetof(H264Context, intra_pcm_ptr));
         memcpy(&h->cabac, &h1->cabac,
                sizeof(H264Context) - offsetof(H264Context, cabac));
-- 
2.1.4



More information about the ffmpeg-devel mailing list