mirror of https://git.ffmpeg.org/ffmpeg.git
asfdec: make sure packet_size is non-zero before seeking
This fixes infinite loops due to seeking back. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
bf50607ab7
commit
2e6ba1993e
|
@ -1291,6 +1291,10 @@ static int asf_read_payload(AVFormatContext *s, AVPacket *pkt)
|
|||
}
|
||||
if (!asf_pkt) {
|
||||
if (asf->packet_offset + asf->packet_size <= asf->data_offset + asf->data_size) {
|
||||
if (!asf->packet_size) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid packet size 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
|
||||
av_log(s, AV_LOG_WARNING, "Skipping the stream with the invalid stream index %d.\n",
|
||||
asf->stream_index);
|
||||
|
|
Loading…
Reference in New Issue