diff options
author | Alexander Strange <astrange@ithinksw.com> | 2009-06-16 21:50:36 +0000 |
---|---|---|
committer | Alexander Strange <astrange@ithinksw.com> | 2009-06-16 21:50:36 +0000 |
commit | d2d5e067359873c3eebaa8e6fbedb5d2ddaab2e3 (patch) | |
tree | 7c17360a3f8b040412a559fde46f92a58aa1e810 /libavcodec | |
parent | 73b02e24604961e49a63ca34203d8f6c56612117 (diff) | |
download | ffmpeg-d2d5e067359873c3eebaa8e6fbedb5d2ddaab2e3.tar.gz |
H.264: Fix memory leaks with multithreading.
The threads' contexts and rbsp_buffers were not freed at the end
of decoding.
Fixes issue 1581
Originally committed as revision 19207 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d269795d45..55553ed313 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1997,6 +1997,9 @@ static void free_tables(H264Context *h){ av_freep(&hx->top_borders[1]); av_freep(&hx->top_borders[0]); av_freep(&hx->s.obmc_scratchpad); + av_freep(&hx->rbsp_buffer[1]); + av_freep(&hx->rbsp_buffer[0]); + if (i) av_freep(&h->thread_context[i]); } } @@ -8123,8 +8126,6 @@ av_cold void ff_h264_free_context(H264Context *h) { int i; - av_freep(&h->rbsp_buffer[0]); - av_freep(&h->rbsp_buffer[1]); free_tables(h); //FIXME cleanup init stuff perhaps for(i = 0; i < MAX_SPS_COUNT; i++) |