Commit d55ebd07 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] ivtv: avoid going past input/audio array

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: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 82387348
...@@ -826,7 +826,7 @@ static void ivtv_init_struct2(struct ivtv *itv) ...@@ -826,7 +826,7 @@ static void ivtv_init_struct2(struct ivtv *itv)
IVTV_CARD_INPUT_VID_TUNER) IVTV_CARD_INPUT_VID_TUNER)
break; break;
} }
if (i == itv->nof_inputs) if (i >= itv->nof_inputs)
i = 0; i = 0;
itv->active_input = i; itv->active_input = i;
itv->audio_input = itv->card->video_inputs[i].audio_index; itv->audio_input = itv->card->video_inputs[i].audio_index;
......
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