[vlc-devel] commit: Fix two uninitialized variables in the v4l2 access module ( Alina Friedrichsen )

git version control git at videolan.org
Sat Sep 12 15:00:51 CEST 2009


vlc | branch: 1.0-bugfix | Alina Friedrichsen <x-alina at gmx.net> | Sat Jul 18 15:04:18 2009 +0200| [6a971478e2404e44def7f6da6762f7bb5f79868c] | committer: 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: Alina Friedrichsen <x-alina at gmx.net>
Signed-off-by: Antoine Cellerier <dionoea at videolan.org>
(cherry picked from commit 288f193ab03076ddcf895562717a186893230d3a)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a971478e2404e44def7f6da6762f7bb5f79868c
---

 modules/access/v4l2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index 9238704..6a39e7b 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -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++;




More information about the vlc-devel mailing list