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

git at videolan.org git at videolan.org
Wed Nov 3 20:22:17 CET 2010


vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Nov  2 21:12:44 2010 +0100| [92d104adda978cdb4dcf69a94d1280e2b490d428] | committer: Rémi Duraffort 

Fixed potential use of non initialized fourcc in rawvideo demuxer.

It could happen when the demuxer was forced.
(cherry picked from commit ba6c81ac46ef8d903004ed5268e6b23e59eb01ba)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 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 120c9e3..071b2b8 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -131,7 +131,7 @@ static int Open( vlc_object_t * p_this )
     int i_width=-1, i_height=-1;
     unsigned u_fps_num=0, u_fps_den=1;
     char *psz_ext;
-    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;
@@ -350,6 +350,12 @@ static int Open( vlc_object_t * p_this )
         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