Commit 288f193a authored by Alina Friedrichsen's avatar Alina Friedrichsen Committed by Antoine Cellerier

Fix two uninitialized variables in the v4l2 access module

Without this patch, the initial value on my system is for example 3, so that two much items are counted. In the second step the function breaks with a error code, when the information downloading of the non-existing item fails.
Signed-off-by: default avatarAlina Friedrichsen <x-alina@gmx.net>
Signed-off-by: default avatarAntoine Cellerier <dionoea@videolan.org>
parent f8980a94
...@@ -2309,6 +2309,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, ...@@ -2309,6 +2309,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
{ {
struct v4l2_standard t_standards; struct v4l2_standard t_standards;
t_standards.index = 0; t_standards.index = 0;
p_sys->i_standard = 0;
while( v4l2_ioctl( i_fd, VIDIOC_ENUMSTD, &t_standards ) >=0 ) while( v4l2_ioctl( i_fd, VIDIOC_ENUMSTD, &t_standards ) >=0 )
{ {
p_sys->i_standard++; p_sys->i_standard++;
...@@ -2372,6 +2373,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, ...@@ -2372,6 +2373,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
{ {
struct v4l2_tuner tuner; struct v4l2_tuner tuner;
memset( &tuner, 0, sizeof(tuner) ); memset( &tuner, 0, sizeof(tuner) );
p_sys->i_tuner = 0;
while( v4l2_ioctl( i_fd, VIDIOC_G_TUNER, &tuner ) >= 0 ) while( v4l2_ioctl( i_fd, VIDIOC_G_TUNER, &tuner ) >= 0 )
{ {
p_sys->i_tuner++; p_sys->i_tuner++;
......
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