Skip to content

Commit

Permalink
V4L/DVB: ivtv: sizeof() => ARRAY_SIZE()
Browse files Browse the repository at this point in the history
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: Dan Carpenter <error27@gmail.com>
Reviewed-by: Andy Walls <awalls@radix.net>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed May 18, 2010
1 parent 7a02264 commit d72d7c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/ivtv/ivtv-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d72d7c1

Please sign in to comment.