diff aviobuf.c @ 643:253b5292946a libavformat

various security fixes and precautionary checks
author michael
date Wed, 12 Jan 2005 00:16:25 +0000
parents 0b52743104ac
children 0ab9b7331748
line wrap: on
line diff
--- a/aviobuf.c	Tue Jan 11 08:16:04 2005 +0000
+++ b/aviobuf.c	Wed Jan 12 00:16:25 2005 +0000
@@ -350,6 +350,9 @@
 int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
 {
     int len;
+    
+    if(size<0)
+        return -1;
 
     len = s->buf_end - s->buf_ptr;
     if (len == 0) {