Commit 0cabddab authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

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

Different return values have been removed, as they were not used.
Fix #7079
parent e6bd3d09
...@@ -170,22 +170,21 @@ static char* GetLine( demux_t *p_demux, int *p_pos ) ...@@ -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 ) static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
{ {
bool b_jpeg = false; bool b_jpeg = false;
int i_pos = 0; int i_pos = 0;
char *psz_line; char *psz_line;
char *p_ch; char *p_ch;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
*p_header_size = -1;
if( !Peek( p_demux, true ) ) if( !Peek( p_demux, true ) )
{ {
msg_Err( p_demux, "cannot peek" ); msg_Err( p_demux, "cannot peek" );
*p_header_size = -1;
return false; return false;
} }
if( p_sys->i_data_peeked < 5) if( p_sys->i_data_peeked < 5)
{ {
msg_Err( p_demux, "data shortage" ); msg_Err( p_demux, "data shortage" );
*p_header_size = -2;
return false; return false;
} }
if( strncmp( (char *)p_sys->p_peek, "--", 2 ) != 0 if( strncmp( (char *)p_sys->p_peek, "--", 2 ) != 0
...@@ -226,7 +225,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size ) ...@@ -226,7 +225,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
if( NULL == psz_line ) if( NULL == psz_line )
{ {
msg_Err( p_demux, "no EOL" ); msg_Err( p_demux, "no EOL" );
*p_header_size = -3;
return false; return false;
} }
...@@ -276,7 +274,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size ) ...@@ -276,7 +274,6 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
if( NULL == psz_line ) if( NULL == psz_line )
{ {
msg_Err( p_demux, "no EOL" ); msg_Err( p_demux, "no EOL" );
*p_header_size = -3;
return false; return false;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment