Module: libav
Branch: master
Commit: 2ee01fbded0a6b35b55d125dfd5807219837cf30

Author:    Ronald S. Bultje <[email protected]>
Committer: Anton Khirnov <[email protected]>
Date:      Sat Mar 24 20:19:19 2012 +0100

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 <[email protected]>

---

 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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to