]> git.sesse.net Git - vlc/commitdiff
Protect against corrupted AVI file.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 24 Jan 2010 13:58:50 +0000 (14:58 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 24 Jan 2010 13:58:50 +0000 (14:58 +0100)
The limit is arbitrary.

modules/demux/avi/libavi.c

index 7da5cb33000672427fd1e3008c898ef8515f6ddd..9f857d867929de6be2f32db4473884b1a489100c 100644 (file)
@@ -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 ) ) ) \
     { \