[PR] avcodec/cbs_av1: pad the ITU-T T.35 payload buffer (PR #23909)

michaelni via ffmpeg-devel <[email protected]> Sat, 25 Jul 2026 11:46:03 -0000
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178497996420.59.16214070698177621697@29965ddac10e>
PR #23909 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23909
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23909.patch

Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <[email protected]>



>From f9151568875f17743a47d7d4c59347eb89156bef Mon Sep 17 00:00:00 2001
From: Kenan Alghythee <[email protected]>
Date: Wed, 22 Jul 2026 19:20:46 +0200
Subject: [PATCH] avcodec/cbs_av1: pad the ITU-T T.35 payload buffer

Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <[email protected]>
---
 libavcodec/cbs_av1_syntax_template.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index f3d84f3c05..6b61e192e2 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -2011,7 +2011,8 @@ static int FUNC(metadata_itut_t35)(CodedBitstreamContext *ctx, RWContext *rw,
     // be arbitrarily many trailing zeroes so we need to read through twice.
     current->payload_size = cbs_av1_get_payload_bytes_left(rw);
 
-    current->payload_ref = av_buffer_alloc(current->payload_size);
+    current->payload_ref = av_buffer_allocz(current->payload_size +
+                                            AV_INPUT_BUFFER_PADDING_SIZE);
     if (!current->payload_ref)
         return AVERROR(ENOMEM);
     current->payload = current->payload_ref->data;
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]