[FFmpeg-cvslog] avdevice/iec61883: Check pthread init for failures

Michael Niedermayer git at videolan.org
Sun Jun 7 19:05:13 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun  7 18:57:55 2015 +0200| [7c453277a399bc81553c6110efd81a0957117138] | committer: Michael Niedermayer

avdevice/iec61883: Check pthread init for failures

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c453277a399bc81553c6110efd81a0957117138
---

 libavdevice/iec61883.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavdevice/iec61883.c b/libavdevice/iec61883.c
index b29aad1..01e5289 100644
--- a/libavdevice/iec61883.c
+++ b/libavdevice/iec61883.c
@@ -392,9 +392,12 @@ static int iec61883_read_header(AVFormatContext *context)
 
 #if THREADS
     dv->thread_loop = 1;
-    pthread_mutex_init(&dv->mutex, NULL);
-    pthread_cond_init(&dv->cond, NULL);
-    pthread_create(&dv->receive_task_thread, NULL, iec61883_receive_task, dv);
+    if (pthread_mutex_init(&dv->mutex, NULL))
+        goto fail;
+    if (pthread_cond_init(&dv->cond, NULL))
+        goto fail;
+    if (pthread_create(&dv->receive_task_thread, NULL, iec61883_receive_task, dv))
+        goto fail;
 #endif
 
     return 0;



More information about the ffmpeg-cvslog mailing list