Commit 3bbe374b authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

nuv: Fix some warnings and fix an issue where some unitialized pointer access...

nuv: Fix some warnings and fix an issue where some unitialized pointer access could lead to a crash.
parent 31523f87
...@@ -461,7 +461,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -461,7 +461,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{ {
i64 = stream_Size( p_demux->s ); i64 = stream_Size( p_demux->s );
if( i64 > 0 ) if( i64 > 0 )
*pf = (double)stream_Tell( p_demux->s ) / (double)i64; {
double current = stream_Tell( p_demux->s );
*pf = current / (double)i64;
}
else else
*pf = 0.0; *pf = 0.0;
} }
...@@ -723,8 +726,8 @@ static int SeekTableLoad( demux_t *p_demux, demux_sys_t *p_sys ) ...@@ -723,8 +726,8 @@ static int SeekTableLoad( demux_t *p_demux, demux_sys_t *p_sys )
{ {
frame_header_t fh; frame_header_t fh;
int64_t i_original_pos; int64_t i_original_pos;
uint8_t* p_seek_table; uint8_t* p_seek_table = NULL;
uint8_t* p_kfa_table; uint8_t* p_kfa_table = NULL;
int32_t i_seek_elements = 0, i_kfa_elements = 0, j; int32_t i_seek_elements = 0, i_kfa_elements = 0, j;
int64_t i_time, i_offset; int64_t i_time, i_offset;
int keyframe, last_keyframe = 0, frame = 0, kfa_entry_id = 0; int keyframe, last_keyframe = 0, frame = 0, kfa_entry_id = 0;
...@@ -804,12 +807,17 @@ static int SeekTableLoad( demux_t *p_demux, demux_sys_t *p_sys ) ...@@ -804,12 +807,17 @@ static int SeekTableLoad( demux_t *p_demux, demux_sys_t *p_sys )
} }
} }
if( i_kfa_elements > 0 ) if( i_kfa_elements > 0 )
msg_Warn( p_demux, "untested keyframe adjust support, upload samples" ); msg_Warn( p_demux, "untested keyframe adjust support, upload samples" );
for(j=0; j < i_seek_elements; j++) for(j = 0; j < i_seek_elements; j++)
{ {
if( !p_seek_table || !p_kfa_table)
{
free(p_seek_table);
free(p_kfa_table);
return VLC_EGENERIC;
}
#if 0 #if 0
uint8_t* p = p_seek_table + j * 12; uint8_t* p = p_seek_table + j * 12;
msg_Dbg( p_demux, "%x %x %x %x %x %x %x %x %x %x %x %x", msg_Dbg( p_demux, "%x %x %x %x %x %x %x %x %x %x %x %x",
......
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