frame_thread_encoder: fix packet memleak
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 28 Oct 2012 15:47:23 +0000 (16:47 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 28 Oct 2012 15:47:23 +0000 (16:47 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/frame_thread_encoder.c

index 26a41af..550d145 100644 (file)
@@ -259,7 +259,7 @@ int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVF
     }
     task = c->finished_tasks[c->finished_task_index];
     *pkt = *(AVPacket*)(task.outdata);
-    c->finished_tasks[c->finished_task_index].outdata= NULL;
+    av_freep(&c->finished_tasks[c->finished_task_index].outdata);
     c->finished_task_index = (c->finished_task_index+1) % BUFFER_SIZE;
     pthread_mutex_unlock(&c->finished_task_mutex);