diff mpegvideo.c @ 6193:52ccab2531bd libavcodec

Fix memory leak in h264 decoder. allocated_edge_emu_buffer was being allocated in both mpegvideo and h264 decoder. Fixed by allowing all (master and duplicate) contexts to fully initialize in MPV_frame_start and copying these into H264Contexts. Mailing list discussion: [FFmpeg-devel] Memory leak in h264 Tue, 22 Jan 2008 15:22:55
author heydowns
date Mon, 28 Jan 2008 21:12:38 +0000
parents bd9a68cc9a17
children 644cc66607b2
line wrap: on
line diff
--- a/mpegvideo.c	Sun Jan 27 23:28:56 2008 +0000
+++ b/mpegvideo.c	Mon Jan 28 21:12:38 2008 +0000
@@ -587,9 +587,7 @@
     s->context_initialized = 1;
 
     s->thread_context[0]= s;
-    /* h264 does thread context setup itself, but it needs context[0]
-     * to be fully initialized for the error resilience code */
-    threads = s->codec_id == CODEC_ID_H264 ? 1 : s->avctx->thread_count;
+    threads = s->avctx->thread_count;
 
     for(i=1; i<threads; i++){
         s->thread_context[i]= av_malloc(sizeof(MpegEncContext));