[vlc-devel] commit: Fix two uninitialized variables in the v4l2 access module ( Alina Friedrichsen )
git version control
git at videolan.org
Sat Jul 18 23:56:38 CEST 2009
vlc | branch: master | Alina Friedrichsen <x-alina at gmx.net> | Sat Jul 18 15:04:18 2009 +0200| [288f193ab03076ddcf895562717a186893230d3a] | 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>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=288f193ab03076ddcf895562717a186893230d3a
---
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 5aeaefc..fabb346 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -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++;
More information about the vlc-devel
mailing list