Skip to content

Commit

Permalink
[media] ivtv: avoid going past input/audio array
Browse files Browse the repository at this point in the history
As reported by smatch:
	drivers/media/pci/ivtv/ivtv-driver.c:832 ivtv_init_struct2() error: buffer overflow 'itv->card->video_inputs' 6 <= 6

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Mauro Carvalho Chehab committed Nov 16, 2015
1 parent 8238734 commit d55ebd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ static void ivtv_init_struct2(struct ivtv *itv)
IVTV_CARD_INPUT_VID_TUNER)
break;
}
if (i == itv->nof_inputs)
if (i >= itv->nof_inputs)
i = 0;
itv->active_input = i;
itv->audio_input = itv->card->video_inputs[i].audio_index;
Expand Down

0 comments on commit d55ebd0

Please sign in to comment.