summaryrefslogtreecommitdiff
path: root/libavcodec/os2thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/os2thread.c')
-rw-r--r--libavcodec/os2thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/os2thread.c b/libavcodec/os2thread.c
index edebc9a6c8..76dc0d56bc 100644
--- a/libavcodec/os2thread.c
+++ b/libavcodec/os2thread.c
@@ -116,6 +116,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;