]> git.sesse.net Git - vlc/commitdiff
* libavi.c: fixed a dead loop when data are missing.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 30 Aug 2003 02:03:44 +0000 (02:03 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 30 Aug 2003 02:03:44 +0000 (02:03 +0000)
modules/demux/avi/libavi.c

index b859a7f9eb3e9a1e43c44d80360fa03d6f033b85..51c9c224c686050e0db9e9be159040cc04367d9b 100644 (file)
@@ -2,7 +2,7 @@
  * libavi.c :
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libavi.c,v 1.24 2003/08/22 22:52:48 fenrir Exp $
+ * $Id: libavi.c,v 1.25 2003/08/30 02:03:44 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -197,9 +197,13 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
     uint8_t  *p_read, *p_buff;    \
     if( !( p_read = p_buff = malloc(i_read ) ) ) \
     { \
-        return 0; \
+        return VLC_EGENERIC; \
     } \
     i_read = stream_Read( s, p_read, i_read ); \
+    if( i_read < (int64_t)__EVEN(p_chk->common.i_chunk_size ) + 8 ) \
+    { \
+        return VLC_EGENERIC; \
+    }\
     p_read += 8; \
     i_read -= 8