diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index baede5ba20..71e65f4763 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -1361,6 +1361,8 @@ static int asf_read_packet_header(AVFormatContext *s) unsigned char error_flags, len_flags, pay_flags; asf->packet_offset = avio_tell(pb); + if (asf->packet_offset > INT64_MAX/2) + asf->packet_offset = 0; error_flags = avio_r8(pb); // read Error Correction Flags if (error_flags & ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT) { if (!(error_flags & ASF_ERROR_CORRECTION_LENGTH_TYPE)) {