]> git.sesse.net Git - vlc/commitdiff
Fixed read(NULL, size) in zipstream.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 27 Feb 2010 21:09:09 +0000 (22:09 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 27 Feb 2010 23:27:08 +0000 (00:27 +0100)
modules/access/zip/zipstream.c

index 0ccaa86d95538aeddb517efe31719f5c2aa43158..abe7ba88acbe942dc1570c73d39e48d318eb72cb 100644 (file)
@@ -253,15 +253,14 @@ static int Read( stream_t *s, void *p_read, unsigned int i_read )
 {
     stream_sys_t *p_sys = s->p_sys;
 
-    if( !p_read ) return 0;
-
     /* Fill the buffer */
     if( Fill( s ) )
         return -1;
 
     /* Read the buffer */
-    int i_len = __MIN( i_read, p_sys->i_len - p_sys->i_pos );
-    memcpy( p_read, p_sys->psz_xspf + p_sys->i_pos, i_len );
+    unsigned i_len = __MIN( i_read, p_sys->i_len - p_sys->i_pos );
+    if( p_read )
+        memcpy( p_read, p_sys->psz_xspf + p_sys->i_pos, i_len );
     p_sys->i_pos += i_len;
 
     return i_len;