[vlc-commits] commit: Fixed potential use of non initialized fourcc in rawvideo demuxer. (Laurent Aimar )

git at videolan.org git at videolan.org
Tue Nov 2 21:20:44 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Nov  2 21:12:44 2010 +0100| [ba6c81ac46ef8d903004ed5268e6b23e59eb01ba] | committer: Laurent Aimar 

Fixed potential use of non initialized fourcc in rawvideo demuxer.

It could happen when the demuxer was forced.

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

 modules/demux/rawvid.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index b1558c9..82e4daa 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -130,7 +130,7 @@ static int Open( vlc_object_t * p_this )
     demux_sys_t *p_sys;
     int i_width=-1, i_height=-1;
     unsigned u_fps_num=0, u_fps_den=1;
-    vlc_fourcc_t i_chroma;
+    vlc_fourcc_t i_chroma = 0;
     unsigned int i_sar_num = 0;
     unsigned int i_sar_den = 0;
     const struct preset_t *p_preset = NULL;
@@ -352,6 +352,12 @@ valid:
         goto error;
     }
 
+    if( i_chroma == 0 )
+    {
+        msg_Err( p_demux, "invalid or no chroma specified." );
+        goto error;
+    }
+
     /* fixup anything missing with sensible assumptions */
     if( i_sar_num <= 0 || i_sar_den <= 0 )
     {



More information about the vlc-commits mailing list