[vlc-commits] mjpeg: Fix uninitialized values for i_size when checking mime header.

Hugo Beauzée-Luyssen git at videolan.org
Fri Sep 21 17:23:47 CEST 2012


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Sep 21 17:08:50 2012 +0300| [0cabddab2e553cd07027a259ead53ab5d98242f8] | committer: Hugo Beauzée-Luyssen

mjpeg: Fix uninitialized values for i_size when checking mime header.

Different return values have been removed, as they were not used.
Fix #7079

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

 modules/demux/mjpeg.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index ca62a21..1a962c3 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -170,22 +170,21 @@ static char* GetLine( demux_t *p_demux, int *p_pos )
  *****************************************************************************/
 static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
 {
-    bool  b_jpeg = false;
+    bool        b_jpeg = false;
     int         i_pos = 0;
     char        *psz_line;
     char        *p_ch;
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    *p_header_size = -1;
     if( !Peek( p_demux, true ) )
     {
         msg_Err( p_demux, "cannot peek" );
-        *p_header_size = -1;
         return false;
     }
     if( p_sys->i_data_peeked < 5)
     {
         msg_Err( p_demux, "data shortage" );
-        *p_header_size = -2;
         return false;
     }
     if( strncmp( (char *)p_sys->p_peek, "--", 2 ) != 0
@@ -226,7 +225,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
         if( NULL == psz_line )
         {
             msg_Err( p_demux, "no EOL" );
-            *p_header_size = -3;
             return false;
         }
 
@@ -276,7 +274,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
     if( NULL == psz_line )
     {
         msg_Err( p_demux, "no EOL" );
-        *p_header_size = -3;
         return false;
     }
 



More information about the vlc-commits mailing list