mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/cbs_h266_syntax_template: bound slice width/height by remaining tiles
Fixes: out of array access Fixes: crash_vvc_heap_oob_read.bin Found-by: akshay jain <akshaythe@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1973,14 +1973,14 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
|
||||
tile_y = tile_idx / current->num_tile_columns;
|
||||
if (tile_x != current->num_tile_columns - 1) {
|
||||
ues(pps_slice_width_in_tiles_minus1[i],
|
||||
0, current->num_tile_columns - 1, 1, i);
|
||||
0, current->num_tile_columns - 1 - tile_x, 1, i);
|
||||
} else {
|
||||
infer(pps_slice_width_in_tiles_minus1[i], 0);
|
||||
}
|
||||
if (tile_y != current->num_tile_rows - 1 &&
|
||||
(current->pps_tile_idx_delta_present_flag || tile_x == 0)) {
|
||||
ues(pps_slice_height_in_tiles_minus1[i],
|
||||
0, current->num_tile_rows - 1, 1, i);
|
||||
0, current->num_tile_rows - 1 - tile_y, 1, i);
|
||||
} else {
|
||||
if (tile_y == current->num_tile_rows - 1)
|
||||
infer(pps_slice_height_in_tiles_minus1[i], 0);
|
||||
|
||||
Reference in New Issue
Block a user