[vlc-commits] commit: Avoid integer overflow (Christophe Mutricy )
git at videolan.org
git at videolan.org
Sat Mar 20 01:41:50 CET 2010
vlc/vlc-1.0 | branch: master | Christophe Mutricy <xtophe at videolan.org> | Fri Mar 19 17:27:01 2010 +0000| [4fb4c208ffbd69c1e501ad2ded13b50e845d5a4c] | committer: Christophe Mutricy
Avoid integer overflow
(cherry picked from commit 6eedf20f375a3cfe4ab475ec3a31fd7f83a5dd19)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.0.git/?a=commit;h=4fb4c208ffbd69c1e501ad2ded13b50e845d5a4c
---
modules/demux/asf/libasf.c | 2 +-
modules/demux/avi/libavi.c | 2 +-
modules/demux/mp4/libmp4.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index 2b71999..740b434 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -1487,7 +1487,7 @@ static void ASF_ObjectDumpDebug( vlc_object_t *p_obj,
psz_name = ASF_ObjectDumpDebugInfo[i].psz_name;
char str[512];
- if( i_level * 5 + 1 >= sizeof(str) )
+ if( i_level >= (sizeof(str) - 1)/5 )
return;
memset( str, ' ', sizeof( str ) );
diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index ffbb3f9..be897a7 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -801,7 +801,7 @@ static void AVI_ChunkDumpDebug_level( vlc_object_t *p_obj,
avi_chunk_t *p_child;
char str[512];
- if( i_level * 5 + 1 >= sizeof(str) )
+ if( i_level >= (sizeof(str) - 1)/5 )
return;
memset( str, ' ', sizeof( str ) );
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 9bf1a9d..dafe7d0 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2879,7 +2879,7 @@ static void __MP4_BoxDumpStructure( stream_t *s,
unsigned int i;
char str[512];
- if( i_level * 5 + 1 >= sizeof(str) )
+ if( i_level >= (sizeof(str) - 1)/5 )
return;
memset( str, ' ', sizeof(str) );
More information about the vlc-commits
mailing list