Commit 75afa63b62 for ffmpeg
commit 75afa63b62c695d38e387ff5d3924144ba2f54a3
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Wed Nov 18 15:52:19 2026 +0100
avcodec/apv_decode: do not start a further primary frame of a packet after ff_thread_finish_setup()
Fixes: out of array write
Fixes: zrDwkIvkDrGG
Fixes: ANT-2026-PUXQAX52
Regression since: 300cac3078
Found-by: Anthropic's OSS Scanner
Out of array write Replicated through UnModified FFmpeg with ASAN
diff --git a/libavcodec/apv_decode.c b/libavcodec/apv_decode.c
index 19c24d293f..799f7ddfeb 100644
--- a/libavcodec/apv_decode.c
+++ b/libavcodec/apv_decode.c
@@ -361,6 +361,12 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output,
APVDerivedTileInfo *tile_info = &apv->tile_info;
int err, job_count;
+ if (!ff_thread_can_start_frame(avctx)) {
+ av_log(avctx, AV_LOG_ERROR, "Multiple primary frames in a packet "
+ "are not supported with frame threading.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
err = apv_decode_check_format(avctx, &input->frame_header);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Unsupported format parameters.\n");