Skip to content

Commit

Permalink
media: media/pci/ivtv: Variable vbi.type could be uninitialized if ma…
Browse files Browse the repository at this point in the history
…cro v4l2_subdev_call set __result an error code

Inside function compress_sliced_buf(), variable vbi.type is
uninitialized if macro v4l2_subdev_call set __result an
error code. However, vbi.type is used in the if statement
without any check, which is potentially unsafe.

Signed-off-by: Yizhuo <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Yizhuo authored and mchehab committed Oct 10, 2019
1 parent 6bf05f7 commit 31218df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static u32 compress_raw_buf(struct ivtv *itv, u8 *buf, u32 size)
static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8 sav)
{
u32 line_size = itv->vbi.sliced_decoder_line_size;
struct v4l2_decode_vbi_line vbi;
struct v4l2_decode_vbi_line vbi = {};
int i;
unsigned lines = 0;

Expand Down

0 comments on commit 31218df

Please sign in to comment.