[vlc-devel] [PATCH] Fix two uninitialized variables in the v4l2 access module
Alina Friedrichsen
x-alina at gmx.net
Sat Jul 18 15:04:18 CEST 2009
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>
---
diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index bb16c0a..0921aa0 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -2307,6 +2307,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++;
@@ -2370,6 +2371,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++;
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
More information about the vlc-devel
mailing list