Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: AV1: Make sure that bit depth in correctly initialize

Make sure that bit_depth field of V4L2_CTRL_TYPE_AV1_SEQUENCE
is initialized correctly before using it.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Benjamin Gaignard and committed by
Mauro Carvalho Chehab
2ef33723 1fb38c3c

+5
+5
drivers/media/v4l2-core/v4l2-ctrls-core.c
··· 111 111 struct v4l2_ctrl_vp9_frame *p_vp9_frame; 112 112 struct v4l2_ctrl_fwht_params *p_fwht_params; 113 113 struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix; 114 + struct v4l2_ctrl_av1_sequence *p_av1_sequence; 114 115 void *p = ptr.p + idx * ctrl->elem_size; 115 116 116 117 if (ctrl->p_def.p_const) ··· 157 156 p_vp9_frame->bit_depth = 8; 158 157 p_vp9_frame->flags |= V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING | 159 158 V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING; 159 + break; 160 + case V4L2_CTRL_TYPE_AV1_SEQUENCE: 161 + p_av1_sequence = p; 162 + p_av1_sequence->bit_depth = 8; 160 163 break; 161 164 case V4L2_CTRL_TYPE_FWHT_PARAMS: 162 165 p_fwht_params = p;