[vlc-devel] commit: Fixed potential invalid reads. (Laurent Aimar )

git version control git at videolan.org
Sun Jul 6 22:48:05 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jul  6 22:12:03 2008 +0000| [730a93d46d103cb76dcd50929865167241c19f9c]

Fixed potential invalid reads.

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

 modules/demux/flac.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index 18f6d88..86a81fb 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -678,17 +678,17 @@ static void ParsePicture( demux_t *p_demux, const uint8_t *p_data, int i_data )
 
     i_type = GetDWBE( p_data ); RM(4);
     i_len = GetDWBE( p_data ); RM(4);
-    if( i_data < i_len + 4 )
+    if( i_len < 0 || i_data < i_len + 4 )
         goto error;
     psz_mime = strndup( p_data, i_len ); RM(i_len);
     i_len = GetDWBE( p_data ); RM(4);
-    if( i_data < i_len + 4*4 + 4)
+    if( i_len < 0 || i_data < i_len + 4*4 + 4)
         goto error;
     psz_description = strndup( p_data, i_len ); RM(i_len);
     EnsureUTF8( psz_description );
     RM(4*4);
     i_len = GetDWBE( p_data ); RM(4);
-    if( i_len > i_data )
+    if( i_len < 0 || i_len > i_data )
         goto error;
 
     msg_Dbg( p_demux, "FLAC: Picture type=%d mime=%s description='%s' file length=%d",




More information about the vlc-devel mailing list