[FFmpeg-cvslog] r19207 - trunk/libavcodec/h264.c

astrange subversion
Tue Jun 16 23:50:37 CEST 2009


Author: astrange
Date: Tue Jun 16 23:50:36 2009
New Revision: 19207

Log:
H.264: Fix memory leaks with multithreading.

The threads' contexts and rbsp_buffers were not freed at the end
of decoding.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	Tue Jun 16 19:33:57 2009	(r19206)
+++ trunk/libavcodec/h264.c	Tue Jun 16 23:50:36 2009	(r19207)
@@ -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(H264Co
 {
     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++)



More information about the ffmpeg-cvslog mailing list