aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje2012-03-24 20:19:19 +0100
committerAnton Khirnov2012-03-24 21:29:35 +0100
commit2ee01fbded0a6b35b55d125dfd5807219837cf30 (patch)
tree6e45c9bcc0c8fc81c67cf2039de6298ec796256a
parentbc1ef85520b6b5adc1361841c24218a9d74454e8 (diff)
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@khirnov.net>
-rw-r--r--libavcodec/pthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index bbbc4829ec..2a11195e78 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;