[vlc-devel] commit: Protect against invalid object size. (Laurent Aimar )

git version control git at videolan.org
Wed Jul 2 21:55:43 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Jul  2 17:23:41 2008 +0000| [237c2d7a9ea4fbcdb95c26e6f4209e59dff5c937]

Protect against invalid object size.

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

 modules/demux/asf/libasf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index e77df7a..b0df919 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -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;
     }




More information about the vlc-devel mailing list