From 4c4c3d5d5abb8192b42d6d18241079929e7317e1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 7 Jun 2015 20:39:27 +0200 Subject: [PATCH] avcodec/libstagefright: Check for pthread_create() failure Signed-off-by: Michael Niedermayer --- libavcodec/libstagefright.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp index 44d7ea1492..11d6038775 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; }