Skip to content

Commit 2ef3372

Browse files
Benjamin Gaignardmchehab
authored andcommitted
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>
1 parent 1fb38c3 commit 2ef3372

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/media/v4l2-core/v4l2-ctrls-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
111111
struct v4l2_ctrl_vp9_frame *p_vp9_frame;
112112
struct v4l2_ctrl_fwht_params *p_fwht_params;
113113
struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
114+
struct v4l2_ctrl_av1_sequence *p_av1_sequence;
114115
void *p = ptr.p + idx * ctrl->elem_size;
115116

116117
if (ctrl->p_def.p_const)
@@ -157,6 +158,10 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
157158
p_vp9_frame->flags |= V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING |
158159
V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING;
159160
break;
161+
case V4L2_CTRL_TYPE_AV1_SEQUENCE:
162+
p_av1_sequence = p;
163+
p_av1_sequence->bit_depth = 8;
164+
break;
160165
case V4L2_CTRL_TYPE_FWHT_PARAMS:
161166
p_fwht_params = p;
162167
p_fwht_params->version = V4L2_FWHT_VERSION;

0 commit comments

Comments
 (0)