summaryrefslogtreecommitdiff
path: root/libavformat/nuv.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-05-29 15:25:45 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-05-29 15:25:45 +0000
commit60583fb653dd2dc665cb4a8b9c755f23ea3cf901 (patch)
tree6582776483515ee7d13d2ce7dea89ab320300628 /libavformat/nuv.c
parent6c10281c3a3c5fe0ce9c5943ed94c73ebd0a5209 (diff)
downloadffmpeg-60583fb653dd2dc665cb4a8b9c755f23ea3cf901.tar.gz
Check av_new_stream return value, fixes CID79 RUN2
Originally committed as revision 13534 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/nuv.c')
-rw-r--r--libavformat/nuv.c4
1 files changed, 4 insertions, 0 deletions
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;