[FFmpeg-cvslog] avcodec/libstagefright: Check for pthread_create() failure

Michael Niedermayer git at videolan.org
Sun Jun 7 21:31:56 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun  7 20:39:27 2015 +0200| [4c4c3d5d5abb8192b42d6d18241079929e7317e1] | committer: Michael Niedermayer

avcodec/libstagefright: Check for pthread_create() failure

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

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

 libavcodec/libstagefright.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp
index 44d7ea1..11d6038 100644
--- a/libavcodec/libstagefright.cpp
+++ b/libavcodec/libstagefright.cpp
@@ -364,7 +364,8 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
     AVFrame *ret_frame;
 
     if (!s->thread_started) {
-        pthread_create(&s->decode_thread_id, NULL, &decode_thread, avctx);
+        if(pthread_create(&s->decode_thread_id, NULL, &decode_thread, avctx))
+            return AVERROR(ENOMEM);
         s->thread_started = true;
     }
 



More information about the ffmpeg-cvslog mailing list