* [FFmpeg-devel] [PATCH] vc1_parser: Reset unesc_index after extracting header with complete frames (PR #20445)
@ 2025-09-05 15:31 DE-AI via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: DE-AI via ffmpeg-devel @ 2025-09-05 15:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: DE-AI
PR #20445 opened by DE-AI
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20445
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20445.patch
When PARSER_FLAG_COMPLETE_FRAMES is set (e.g. in Matroska),
unesc_index is not reset after the first frame, which causes
subsequent frames to inherit leftover header data.
This leads to incorrect keyframe marking and broken decoding.
See also this bug report: https://trac.ffmpeg.org/ticket/8515
Signed-off-by: DE-AI <max.christoph@pentaxmedical.com>
>From 9be0b59b547db94670319cf0073645d32dd2615c Mon Sep 17 00:00:00 2001
From: DE-AI <max.christoph@pentaxmedical.com>
Date: Fri, 5 Sep 2025 15:27:01 +0000
Subject: [PATCH] vc1_parser: Reset unesc_index after extracting header with
complete frames
When PARSER_FLAG_COMPLETE_FRAMES is set (e.g. in Matroska),
unesc_index is not reset after the first frame, which causes
subsequent frames to inherit leftover header data.
This leads to incorrect keyframe marking and broken decoding.
See also this bug report: https://trac.ffmpeg.org/ticket/8515
Signed-off-by: DE-AI <max.christoph@pentaxmedical.com>
---
libavcodec/vc1_parser.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index a536a7bcf8..124a7a771f 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -179,6 +179,7 @@ static int vc1_parse(AVCodecParserContext *s,
// start codes if we know it contains a complete frame and
// we've already unescaped all we need of the frame header
vc1_extract_header(s, avctx, unesc_buffer, unesc_index);
+ unesc_index = 0;
break;
}
if (unesc_index >= UNESCAPED_THRESHOLD && !start_code_found) {
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-05 15:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-05 15:31 [FFmpeg-devel] [PATCH] vc1_parser: Reset unesc_index after extracting header with complete frames (PR #20445) DE-AI via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git