Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-28 20:04:11 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-10-28 20:04:11 +0400
commitf472d01c25a875d46a2b178c7817a9e44ab57ebd (patch)
tree1ffd83a05158c5fa08f353e35b00810f8f7b76a1 /libavcodec/frame_thread_encoder.c
parent991db639516669f65ce521a2dcef05bd12daba7c (diff)
frame_thread_encode: fix context memleak
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/frame_thread_encoder.c')
-rw-r--r--libavcodec/frame_thread_encoder.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 550d145892..664526a303 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -152,16 +152,14 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
for(i=0; i<avctx->thread_count ; i++){
AVDictionary *tmp = NULL;
+ void *tmpv;
AVCodecContext *thread_avctx = avcodec_alloc_context3(avctx->codec);
if(!thread_avctx)
goto fail;
+ tmpv = thread_avctx->priv_data;
*thread_avctx = *avctx;
+ thread_avctx->priv_data = tmpv;
thread_avctx->internal = NULL;
- thread_avctx->priv_data = av_malloc(avctx->codec->priv_data_size);
- if(!thread_avctx->priv_data) {
- av_freep(&thread_avctx);
- goto fail;
- }
memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
thread_avctx->thread_count = 1;
thread_avctx->active_thread_type &= ~FF_THREAD_FRAME;