[PATCH v4 05/17] media: v4l2-ctrls: validate vp9 tile_rows_log2

Sofus Forstreuter sofus.c at icloud.com
Sat Nov 28 14:02:24 PST 2026


tile_rows_log2 does not have a maximum specified in the spec, but it can
be derived from 6.2.13 Tile info syntax:

tile_rows_log2 = f(1)
if (tile_rows_log2 == 1)
  tile_rows_log2 += f(1)

Reviewed-by: Neal Gompa <neal at gompa.dev>
Signed-off-by: Sofus Forstreuter <sofus.c at icloud.com>
---
 drivers/media/v4l2-core/v4l2-ctrls-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c
index 6ded78ef7b0f..5261028767ef 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
@@ -644,7 +644,7 @@ validate_vp9_frame(struct v4l2_ctrl_vp9_frame *frame)
 	 * According to the spec, tile_cols_log2 shall be less than or equal
 	 * to 6.
 	 */
-	if (frame->tile_cols_log2 > 6)
+	if (frame->tile_cols_log2 > 6 || frame->tile_rows_log2 > 2)
 		return -EINVAL;
 
 	if (frame->reference_mode > V4L2_VP9_REFERENCE_MODE_SELECT)

-- 
2.56.0




More information about the Linux-rockchip mailing list