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

git version control git at videolan.org
Wed Sep 17 02:03:59 CEST 2008


vlc | branch: 0.9-bugfix | Pierre d'Herbemont <pdherbemont at videolan.org> | Wed Sep 17 01:40:22 2008 +0200| [189d6e7fea814eb8e9522e643d0b50e777e26f94] | committer: Jean-Baptiste Kempf 

avformat: Don't accept negative size.
(cherry picked from commit bf5cbff5d6dc1844c762e7e23a55e18abc1ad628)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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