summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-13 17:46:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-13 17:46:17 +0100
commit7726916c14e3385148b92dbd23a89948c2c29c09 (patch)
tree9a666e0d2de789cb00cea98bec98309d1a9de850
parent0ea4742341726ebe42c301bc0d6426cfa01dd134 (diff)
mpegts: check av_new_stream() return value.
Fixes CID703728 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 86a4bb3825..5bd3c06ade 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1505,6 +1505,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
pes = ts->pids[pid]->u.pes_filter.opaque;
if (!pes->st) {
pes->st = avformat_new_stream(pes->stream, NULL);
+ if (!pes->st)
+ goto out;
pes->st->id = pes->pid;
}
st = pes->st;
@@ -1513,6 +1515,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
pes = add_pes_stream(ts, pid, pcr_pid);
if (pes) {
st = avformat_new_stream(pes->stream, NULL);
+ if (!st)
+ goto out;
st->id = pes->pid;
}
} else {
@@ -1521,6 +1525,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
st = ts->stream->streams[idx];
} else {
st = avformat_new_stream(ts->stream, NULL);
+ if (!st)
+ goto out;
st->id = pid;
st->codec->codec_type = AVMEDIA_TYPE_DATA;
}