aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-20 12:56:41 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-21 14:37:48 +0100
commit629b2ed0ac77d7c4bf1aeac5e70cafee5fa0fcae (patch)
treefe2d442ba395e5865638dcdb6249e68aefcab224 /libavformat
parentf22aa6b841dc54fa1dd804303885b1e230a5f629 (diff)
downloadffmpeg-629b2ed0ac77d7c4bf1aeac5e70cafee5fa0fcae.tar.gz
flvdec: make sure to check create_stream and report the same error
CC: libav-stable@libav.org Bug-Id: CID 732242
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 1c92cc5757..2d5e50e257 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -717,7 +717,7 @@ static int flv_data_packet(AVFormatContext *s, AVPacket *pkt,
if (i == s->nb_streams) {
st = create_stream(s, AVMEDIA_TYPE_DATA);
if (!st)
- return AVERROR_INVALIDDATA;
+ return AVERROR(ENOMEM);
st->codec->codec_id = AV_CODEC_ID_TEXT;
}
@@ -817,9 +817,12 @@ skip:
break;
}
}
- if (i == s->nb_streams)
+ if (i == s->nb_streams) {
st = create_stream(s, is_audio ? AVMEDIA_TYPE_AUDIO
: AVMEDIA_TYPE_VIDEO);
+ if (!st)
+ return AVERROR(ENOMEM);
+ }
av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||