This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.0
in repository ffmpeg.

commit d1e86151c060792209daa57ebffb143e7de1206c
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Sep 17 21:56:17 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Fri Sep 18 00:48:42 2026 +0200

    avcodec/vulkan_hevc: bound the per category reference counts in 
vk_hevc_start_frame
    
    Fixes: out of array write
    Found-by: Michael Niedermayer with Forgejo Fairy
    (cherry picked from commit 68845e26f781bed7d6de7f27b4b57b7c2d2d7648)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/vulkan_hevc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index a837e57ba9..9110128d85 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -773,6 +773,13 @@ static int vk_hevc_start_frame(AVCodecContext          
*avctx,
         nb_refs++;
     }
 
+    if (h->rps[ST_CURR_BEF].nb_refs > 
FF_ARRAY_ELEMS(hp->h265pic.RefPicSetStCurrBefore) ||
+        h->rps[ST_CURR_AFT].nb_refs > 
FF_ARRAY_ELEMS(hp->h265pic.RefPicSetStCurrAfter)  ||
+        h->rps[LT_CURR].nb_refs     > 
FF_ARRAY_ELEMS(hp->h265pic.RefPicSetLtCurr)) {
+        av_log(avctx, AV_LOG_ERROR, "Too many reference frames\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     memset(hp->h265pic.RefPicSetStCurrBefore, 0xff, 8);
     for (int i = 0; i < h->rps[ST_CURR_BEF].nb_refs; i++) {
         HEVCFrame *frame = h->rps[ST_CURR_BEF].ref[i];

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to