summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-03-24 23:34:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-25 12:22:06 +0200
commit5420523ae3aa379a3274cf715e35ed18efbe6158 (patch)
treea096c4ae8ff384abffe6adcc10f91c4ff4504562 /libavcodec/pthread.c
parente0c71283023163dc6431f000cdb5a661b05beae0 (diff)
pthread: return proper error code on pthread_create failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index e155f73680..e253eb9c36 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -875,7 +875,8 @@ static int frame_thread_init(AVCodecContext *avctx)
if (err) goto error;
- p->thread_init= !pthread_create(&p->thread, NULL, frame_worker_thread, p);
+ err = AVERROR(pthread_create(&p->thread, NULL, frame_worker_thread, p));
+ p->thread_init= !err;
if(!p->thread_init)
goto error;
}