]> git.sesse.net Git - vlc/commitdiff
Protect against invalid object size.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 2 Jul 2008 17:23:41 +0000 (17:23 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 2 Jul 2008 19:57:30 +0000 (19:57 +0000)
modules/demux/asf/libasf.c

index e77df7ae6d867378e17654ce5aab9cead1ef1f2c..b0df9191fe76860ba95580e8ead50c000f0f6bdc 100644 (file)
@@ -218,7 +218,7 @@ static int ASF_ReadObject_Index( stream_t *s, asf_object_t *p_obj )
     int                 i;
 
     if( stream_Peek( s, &p_peek, p_index->i_object_size ) <
-        (int)p_index->i_object_size )
+        __MAX( (int)p_index->i_object_size, 56 ) )
     {
         /* Just ignore */
         return VLC_SUCCESS;
@@ -334,7 +334,7 @@ static int ASF_ReadObject_metadata( stream_t *s, asf_object_t *p_obj )
     p_meta->record = 0;
 
     if( stream_Peek( s, &p_peek, p_meta->i_object_size ) <
-        (int)p_meta->i_object_size )
+        __MAX( (int)p_meta->i_object_size, 26 ) )
     {
        return VLC_EGENERIC;
     }