1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

Check av_new_stream return value, fixes CID79 RUN2

Originally committed as revision 13534 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger
2008-05-29 15:25:45 +00:00
parent 6c10281c3a
commit 60583fb653

View File

@@ -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;