Commit 6eedf20f authored by Christophe Mutricy's avatar Christophe Mutricy

Avoid integer overflow

parent 9b944bbb
...@@ -1487,7 +1487,7 @@ static void ASF_ObjectDumpDebug( vlc_object_t *p_obj, ...@@ -1487,7 +1487,7 @@ static void ASF_ObjectDumpDebug( vlc_object_t *p_obj,
psz_name = ASF_ObjectDumpDebugInfo[i].psz_name; psz_name = ASF_ObjectDumpDebugInfo[i].psz_name;
char str[512]; char str[512];
if( i_level * 5 + 1 >= sizeof(str) ) if( i_level >= (sizeof(str) - 1)/5 )
return; return;
memset( str, ' ', sizeof( str ) ); memset( str, ' ', sizeof( str ) );
......
...@@ -803,7 +803,7 @@ static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj, ...@@ -803,7 +803,7 @@ static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj,
avi_chunk_t *p_child; avi_chunk_t *p_child;
char str[512]; char str[512];
if( i_level * 5 + 1 >= sizeof(str) ) if( i_level >= (sizeof(str) - 1)/5 )
return; return;
memset( str, ' ', sizeof( str ) ); memset( str, ' ', sizeof( str ) );
......
...@@ -2895,7 +2895,7 @@ static void __MP4_BoxDumpStructure( stream_t *s, ...@@ -2895,7 +2895,7 @@ static void __MP4_BoxDumpStructure( stream_t *s,
unsigned int i; unsigned int i;
char str[512]; char str[512];
if( i_level * 5 + 1 >= sizeof(str) ) if( i_level >= (sizeof(str) - 1)/5 )
return; return;
memset( str, ' ', sizeof(str) ); memset( str, ' ', sizeof(str) );
......
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