Commit c6a68b6e45 for ffmpeg
commit c6a68b6e453546dbc5afeabf7f7a1dec8ef3f1dd
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Oct 24 06:08:55 2026 +0200
avcodec/vp9: reject frames with different U and V strides
Fixes: K1QeU7Q1W8m1/testcase/vp9_driver.c
Fixes: K1QeU7Q1W8m1
Fixes: AISLE-2026-0150-00612
Out of array write Replicated through API with ASAN
Found-by: Joshua Rogers (AISLE)
The report suggested using linesize[2] for the V plane throughout the
decoder or rejecting unequal strides after get_buffer2().
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 83d712bb25..3a52b8444f 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -114,6 +114,12 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f)
if (ret < 0)
return ret;
+ if (!avctx->hwaccel && f->tf.f->linesize[1] != f->tf.f->linesize[2]) {
+ av_log(avctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n");
+ ret = AVERROR_PATCHWELCOME;
+ goto fail;
+ }
+
sz = 64 * s->sb_cols * s->sb_rows;
if (sz != s->frame_extradata_pool_size) {
av_refstruct_pool_uninit(&s->frame_extradata_pool);