summaryrefslogtreecommitdiff
path: root/libavcodec/beosthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/beosthread.c')
-rw-r--r--libavcodec/beosthread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/beosthread.c b/libavcodec/beosthread.c
index e2fd97777d..290e48c93f 100644
--- a/libavcodec/beosthread.c
+++ b/libavcodec/beosthread.c
@@ -123,6 +123,9 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){
s->thread_count= thread_count;
+ if (thread_count <= 1)
+ return 0;
+
assert(!s->thread_opaque);
c= av_mallocz(sizeof(ThreadContext)*thread_count);
s->thread_opaque= c;