pthread: return proper error code on pthread_create failure
authorMarton Balint <cus@passwd.hu>
Sat, 24 Mar 2012 22:34:43 +0000 (23:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Mar 2012 10:22:06 +0000 (12:22 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pthread.c

index e155f73..e253eb9 100644 (file)
@@ -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;
     }