mpegts: check av_new_stream() return value.
Fixes CID703728 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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;
|
pes = ts->pids[pid]->u.pes_filter.opaque;
|
||||||
if (!pes->st) {
|
if (!pes->st) {
|
||||||
pes->st = avformat_new_stream(pes->stream, NULL);
|
pes->st = avformat_new_stream(pes->stream, NULL);
|
||||||
|
if (!pes->st)
|
||||||
|
goto out;
|
||||||
pes->st->id = pes->pid;
|
pes->st->id = pes->pid;
|
||||||
}
|
}
|
||||||
st = pes->st;
|
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);
|
pes = add_pes_stream(ts, pid, pcr_pid);
|
||||||
if (pes) {
|
if (pes) {
|
||||||
st = avformat_new_stream(pes->stream, NULL);
|
st = avformat_new_stream(pes->stream, NULL);
|
||||||
|
if (!st)
|
||||||
|
goto out;
|
||||||
st->id = pes->pid;
|
st->id = pes->pid;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1521,6 +1525,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
|||||||
st = ts->stream->streams[idx];
|
st = ts->stream->streams[idx];
|
||||||
} else {
|
} else {
|
||||||
st = avformat_new_stream(ts->stream, NULL);
|
st = avformat_new_stream(ts->stream, NULL);
|
||||||
|
if (!st)
|
||||||
|
goto out;
|
||||||
st->id = pid;
|
st->id = pid;
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user