From 60583fb653dd2dc665cb4a8b9c755f23ea3cf901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Thu, 29 May 2008 15:25:45 +0000 Subject: [PATCH] Check av_new_stream return value, fixes CID79 RUN2 Originally committed as revision 13534 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/nuv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/nuv.c b/libavformat/nuv.c index f56d116ff1..88765af9f5 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -149,6 +149,8 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { if (v_packs) { ctx->v_id = stream_nr++; vst = av_new_stream(s, ctx->v_id); + if (!vst) + return AVERROR(ENOMEM); vst->codec->codec_type = CODEC_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_NUV; vst->codec->width = width; @@ -163,6 +165,8 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { if (a_packs) { ctx->a_id = stream_nr++; ast = av_new_stream(s, ctx->a_id); + if (!ast) + return AVERROR(ENOMEM); ast->codec->codec_type = CODEC_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_S16LE; ast->codec->channels = 2;