[FFmpeg-cvslog] pthread: free progress if buffer allocation failed.

Ronald S. Bultje git at videolan.org
Sun Mar 25 03:10:32 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sat Mar 24 20:19:19 2012 +0100| [2ee01fbded0a6b35b55d125dfd5807219837cf30] | committer: Anton Khirnov

pthread: free progress if buffer allocation failed.

Else we run out of progress variables after a few failed buffer
allocations.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ee01fbded0a6b35b55d125dfd5807219837cf30
---

 libavcodec/pthread.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index bbbc482..2a11195 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -951,6 +951,10 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
             ff_thread_finish_setup(avctx);
     }
 
+    if (err) {
+        free_progress(f);
+        f->thread_opaque = NULL;
+    }
     pthread_mutex_unlock(&p->parent->buffer_mutex);
 
     return err;



More information about the ffmpeg-cvslog mailing list