[vlc-devel] commit: Protect against corrupted AVI file. (Laurent Aimar )

git version control git at videolan.org
Sun Jan 24 14:59:43 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan 24 14:58:50 2010 +0100| [351e7db465f30ab5600560d5ca3357e6d5f5bca6] | committer: Laurent Aimar 

Protect against corrupted AVI file.

The limit is arbitrary.

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

 modules/demux/avi/libavi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index 7da5cb3..9f857d8 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -203,6 +203,11 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
 
 #define AVI_READCHUNK_ENTER \
     int64_t i_read = __EVEN(p_chk->common.i_chunk_size ) + 8; \
+    if( i_read > 100000000 ) \
+    { \
+        msg_Err( s, "Big chunk ignored" ); \
+        return VLC_EGENERIC; \
+    } \
     uint8_t  *p_read, *p_buff;    \
     if( !( p_read = p_buff = malloc(i_read ) ) ) \
     { \




More information about the vlc-devel mailing list