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

Git pushed a commit to branch master
in repository ffmpeg.

commit c7d58bda1505563429b5c9055d5667c2b01ccf64
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Oct 12 03:12:36 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 19 23:40:15 2026 +0000

    avcodec/vvc/ps: bound the tile scans in subpic_tiles()
    
    Fixes: heap-buffer-overflow (read)
    Fixes: q0RFgfMenefI
    Fixes: ANT-2026-HRT03RV0
    Fixes: vvc-subpic-tiles.mkv
    Found-by: Claude and Ada Logics
    
    Out of array read Replicated through UnModified FFmpeg with ASAN
---
 libavcodec/vvc/ps.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c
index 460877246e..48468f5019 100644
--- a/libavcodec/vvc/ps.c
+++ b/libavcodec/vvc/ps.c
@@ -438,11 +438,11 @@ static int pps_single_slice_picture(VVCPPS *pps, int *off)
     return 0;
 }
 
-static int tile_at_or_after(const uint16_t *bd, const int ctb_pos)
+static int tile_at_or_after(const uint16_t *bd, const int num_tiles, const int 
ctb_pos)
 {
     int tile = 0;
 
-    while (bd[tile] < ctb_pos)
+    while (tile < num_tiles && bd[tile] < ctb_pos)
         tile++;
 
     return tile;
@@ -451,13 +451,14 @@ static int tile_at_or_after(const uint16_t *bd, const int 
ctb_pos)
 static void subpic_tiles(int *tile_x, int *tile_y, int *tile_x_end, int 
*tile_y_end,
     const VVCSPS *sps, const VVCPPS *pps,  const int i)
 {
+    const H266RawPPS *r = pps->r;
     const int rx = sps->r->sps_subpic_ctu_top_left_x[i];
     const int ry = sps->r->sps_subpic_ctu_top_left_y[i];
 
-    *tile_x     = tile_at_or_after(pps->col_bd, rx);
-    *tile_y     = tile_at_or_after(pps->row_bd, ry);
-    *tile_x_end = tile_at_or_after(pps->col_bd, rx + 
sps->r->sps_subpic_width_minus1[i] + 1);
-    *tile_y_end = tile_at_or_after(pps->row_bd, ry + 
sps->r->sps_subpic_height_minus1[i] + 1);
+    *tile_x     = tile_at_or_after(pps->col_bd, r->num_tile_columns, rx);
+    *tile_y     = tile_at_or_after(pps->row_bd, r->num_tile_rows,    ry);
+    *tile_x_end = tile_at_or_after(pps->col_bd, r->num_tile_columns, rx + 
sps->r->sps_subpic_width_minus1[i] + 1);
+    *tile_y_end = tile_at_or_after(pps->row_bd, r->num_tile_rows,    ry + 
sps->r->sps_subpic_height_minus1[i] + 1);
 }
 
 static int pps_subpic_less_than_one_tile_slice(VVCPPS *pps, const VVCSPS *sps, 
const int i, const int tx, const int ty, int *off)

-- 
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