]> git.sesse.net Git - vlc/commitdiff
Fix two uninitialized variables in the v4l2 access module
authorAlina Friedrichsen <x-alina@gmx.net>
Sat, 18 Jul 2009 13:04:18 +0000 (15:04 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 18 Jul 2009 21:25:04 +0000 (23:25 +0200)
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: Alina Friedrichsen <x-alina@gmx.net>
Signed-off-by: Antoine Cellerier <dionoea@videolan.org>
modules/access/v4l2.c

index 5aeaefc331b6548a1d794b1e0a4dc63754e31070..fabb346f3f999850a29501c76f93254211b17c39 100644 (file)
@@ -2309,6 +2309,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++;
@@ -2372,6 +2373,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++;