diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 33aeaedf6b..d0fa80f806 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1709,7 +1709,11 @@ static int decode_update_thread_context(AVCodecContext *dst, av_log(dst, AV_LOG_ERROR, "Could not allocate memory for h264\n"); return ret; } - context_init(h); + ret = context_init(h); + if (ret < 0) { + av_log(dst, AV_LOG_ERROR, "context_init() failed.\n"); + return ret; + } } for (i = 0; i < 2; i++) {