Mercurial > libavformat.hg
changeset 3401:1ea33ee5ed04 libavformat
Check av_new_stream return value, fixes CID79 RUN2
author | reimar |
---|---|
date | Thu, 29 May 2008 15:25:45 +0000 |
parents | 75d4db7ae5c9 |
children | c30e9e11baf9 |
files | nuv.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/nuv.c Thu May 29 15:22:45 2008 +0000 +++ b/nuv.c Thu May 29 15:25:45 2008 +0000 @@ -149,6 +149,8 @@ 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 @@ 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;