Commit d72d7c1d authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

V4L/DVB: ivtv: sizeof() => ARRAY_SIZE()

This fixes a smatch warning:
drivers/media/video/ivtv/ivtv-vbi.c +138 ivtv_write_vbi(43)
	error: buffer overflow 'vi->cc_payload' 256 <= 1023
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarAndy Walls <awalls@radix.net>
Signed-off-by: default avatarAndy Walls <awalls@radix.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7a02264c
......@@ -134,7 +134,7 @@ void ivtv_write_vbi(struct ivtv *itv, const struct v4l2_sliced_vbi_data *sliced,
}
}
}
if (found_cc && vi->cc_payload_idx < sizeof(vi->cc_payload)) {
if (found_cc && vi->cc_payload_idx < ARRAY_SIZE(vi->cc_payload)) {
vi->cc_payload[vi->cc_payload_idx++] = cc;
set_bit(IVTV_F_I_UPDATE_CC, &itv->i_flags);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment