Skip to content
Snippets Groups Projects
Commit 2e6ba199 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Luca Barbato
Browse files

asfdec: make sure packet_size is non-zero before seeking


This fixes infinite loops due to seeking back.

Signed-off-by: default avatarAlexandra Hájková <alexandra@khirnov.net>
Signed-off-by: default avatarLuca Barbato <lu_zero@gentoo.org>
parent bf50607a
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment