[vlc-commits] asf: fix integer underflow

Rémi Denis-Courmont git at videolan.org
Sat Nov 11 15:37:05 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 11 16:19:35 2017 +0200| [775a3048419dca3ec90ae12bdad4d40b660ac236] | committer: Rémi Denis-Courmont

asf: fix integer underflow

We substract 56 from the size later in the function.

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

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

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index 6d4bfcfc8e..76331e451e 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -252,8 +252,8 @@ static int ASF_ReadObject_Index( stream_t *s, asf_object_t *p_obj )
     unsigned int       i;
 
     /* We just ignore error on the index */
-    if( vlc_stream_Peek( s, &p_peek, p_index->i_object_size ) <
-        __MAX( (int64_t)p_index->i_object_size, 56 ) )
+    if( p_index->i_object_size < 56
+     || vlc_stream_Peek( s, &p_peek, p_index->i_object_size ) < 56 )
         return VLC_SUCCESS;
 
     ASF_GetGUID( &p_index->i_file_id, p_peek + ASF_OBJECT_COMMON_SIZE );



More information about the vlc-commits mailing list