Commit d225503a3c for ffmpeg
commit d225503a3c99516d6675d91f9d6e6807940644f6
Author: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Date: Wed Dec 2 20:14:36 2026 -0800
avformat/asfdec_f: skip error correction parity packets
The demuxer parsed Type 2 parity bytes as packet headers. Skipping
parity removes spurious diagnostics on the vidtoasf sample and
prevents duplicate media packets when the parity span is one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index 4c9925bc39..cfac708115 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -943,6 +943,14 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
e = avio_r8(pb);
avio_seek(pb, (c & 0xF) - 2, SEEK_CUR);
rsize += c & 0xF;
+ /* parity packet: XOR of the span, no payload to demux */
+ if (c == 0x92 && (d & 0xF) == 2 && s->packet_size > 3 &&
+ s->packet_size == asf->hdr.min_pktsize) {
+ asf->packet_segments = 0;
+ asf->packet_size_left = 0;
+ asf->packet_padsize = s->packet_size - 3;
+ return 0;
+ }
}
if (c != 0x82)