You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
asfdec_o: make sure packet_size is non-zero before seeking
This fixes infinite loops due to seeking back.
Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3776a72962
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
@ -1287,6 +1287,10 @@ static int asf_read_payload(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
if (!asf_pkt) {
|
if (!asf_pkt) {
|
||||||
if (asf->packet_offset + asf->packet_size <= asf->data_offset + asf->data_size) {
|
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);
|
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",
|
av_log(s, AV_LOG_WARNING, "Skipping the stream with the invalid stream index %d.\n",
|
||||||
asf->stream_index);
|
asf->stream_index);
|
||||||
|
Reference in New Issue
Block a user