mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avformat/utils: Assert that stream_index is valid
There is currently an ordinary check for this (which would lead to a memleak), but given that no demuxer should ever return a packet with an invalid stream_index it is more appropriate for this to be an assert. FATE passes with this change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
c23797bc33
commit
e045be92cd
@ -884,10 +884,8 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pkt->stream_index >= (unsigned)s->nb_streams) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid stream index %d\n", pkt->stream_index);
|
||||
continue;
|
||||
}
|
||||
av_assert0(pkt->stream_index < (unsigned)s->nb_streams &&
|
||||
"Invalid stream index.\n");
|
||||
|
||||
st = s->streams[pkt->stream_index];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user