[vlc-devel] commit: avformat: Don't accept negative size. (Pierre d'Herbemont )

git version control git at videolan.org
Wed Sep 17 01:37:37 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Wed Sep 17 01:40:22 2008 +0200| [bf5cbff5d6dc1844c762e7e23a55e18abc1ad628] | committer: Pierre d'Herbemont 

avformat: Don't accept negative size.

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

 modules/demux/avformat/demux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index c9481bd..11bea18 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -488,6 +488,7 @@ static int IORead( void *opaque, uint8_t *buf, int buf_size )
 {
     URLContext *p_url = opaque;
     demux_t *p_demux = p_url->priv_data;
+    if( buf_size < 0 ) return -1;
     int i_ret = stream_Read( p_demux->s, buf, buf_size );
     return i_ret ? i_ret : -1;
 }




More information about the vlc-devel mailing list