mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
media: mediatek: vcodec: bound AV1 tile-start copy to the array capacity
vdec_av1_slice_setup_tile() copies tile_cols + 1 / tile_rows + 1 entries
into mi_col_starts[] / mi_row_starts[] from the bitstream tile_info. Bound
the copy to the array capacity.
Fixes: 0934d37596 ("media: mediatek: vcodec: separate decoder and encoder")
Assisted-by: Claude:claude-opus-4-8
Cc: stable@vger.kernel.org
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
367db8b23c
commit
37bef2170d
|
|
@ -1299,11 +1299,12 @@ static void vdec_av1_slice_setup_tile(struct vdec_av1_slice_frame *frame,
|
|||
tile->uniform_tile_spacing_flag =
|
||||
BIT_FLAG(ctrl_tile, V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING);
|
||||
|
||||
for (i = 0; i < tile->tile_cols + 1; i++)
|
||||
/* Bound the copy to the mi_col_starts[]/mi_row_starts[] capacity. */
|
||||
for (i = 0; i < tile->tile_cols + 1 && i < V4L2_AV1_MAX_TILE_COLS + 1; i++)
|
||||
tile->mi_col_starts[i] =
|
||||
ALIGN(ctrl_tile->mi_col_starts[i], BIT(mib_size_log2)) >> mib_size_log2;
|
||||
|
||||
for (i = 0; i < tile->tile_rows + 1; i++)
|
||||
for (i = 0; i < tile->tile_rows + 1 && i < V4L2_AV1_MAX_TILE_ROWS + 1; i++)
|
||||
tile->mi_row_starts[i] =
|
||||
ALIGN(ctrl_tile->mi_row_starts[i], BIT(mib_size_log2)) >> mib_size_log2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user