pthread: free progress if buffer allocation failed.
authorRonald S. Bultje <rsbultje@gmail.com>
Sat, 24 Mar 2012 19:19:19 +0000 (20:19 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sat, 24 Mar 2012 20:29:35 +0000 (21:29 +0100)
Else we run out of progress variables after a few failed buffer
allocations.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/pthread.c

index bbbc482..2a11195 100644 (file)
@@ -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;