From: Rafaël Carré Date: Fri, 6 Jun 2008 10:03:03 +0000 (+0200) Subject: Revert "stream_Read() : makes the buffer mandatory" X-Git-Tag: 0.9.0-test0~319 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7076fe3a4144be3b546eceefbd2578d1cca2521d;p=vlc Revert "stream_Read() : makes the buffer mandatory" This reverts commit 0bcda15e362b5e00fd4b6f458206ac52035b217d. --- diff --git a/src/input/stream.c b/src/input/stream.c index b98b26d940..0c60db9e77 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -804,10 +804,13 @@ static int AStreamReadBlock( stream_t *s, void *p_read, int i_read ) int i_copy = __MIN( i_current, i_read - i_data); /* Copy data */ - memcpy( p_data, + if( p_data ) + { + memcpy( p_data, &p_sys->block.p_current->p_buffer[p_sys->block.i_offset], i_copy ); - p_data += i_copy; + p_data += i_copy; + } i_data += i_copy; p_sys->block.i_offset += i_copy; @@ -1145,8 +1148,11 @@ static int AStreamReadStream( stream_t *s, void *p_read, int i_read ) /* Copy data */ /* msg_Dbg( s, "AStreamReadStream: copy %d", i_copy ); */ - memcpy( p_data, &tk->p_buffer[i_off], i_copy ); - p_data += i_copy; + if( p_data ) + { + memcpy( p_data, &tk->p_buffer[i_off], i_copy ); + p_data += i_copy; + } i_data += i_copy; p_sys->stream.i_offset += i_copy; @@ -2068,8 +2074,6 @@ static int ASeek( stream_t *s, int64_t i_pos ) */ int stream_Read( stream_t *s, void *p_read, int i_read ) { - assert( s ); - assert( p_read ); return s->pf_read( s, p_read, i_read ); }