Commit 6a971478 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>
(cherry picked from commit 288f193a)
parent 614d478c
......@@ -2330,6 +2330,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
{
struct v4l2_standard t_standards;
t_standards.index = 0;
p_sys->i_standard = 0;
while( v4l2_ioctl( i_fd, VIDIOC_ENUMSTD, &t_standards ) >=0 )
{
p_sys->i_standard++;
......@@ -2393,6 +2394,7 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys,
{
struct v4l2_tuner tuner;
memset( &tuner, 0, sizeof(tuner) );
p_sys->i_tuner = 0;
while( v4l2_ioctl( i_fd, VIDIOC_G_TUNER, &tuner ) >= 0 )
{
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