Commit 1403a857 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

stream: Don't attempt to seek() when reading to NULL in *Immediate method, as pointed by Rémi.

parent e0791ca6
......@@ -1524,22 +1524,6 @@ static int AStreamReadImmediate( stream_t *s, void *p_read, int i_read )
p_read, i_read );
#endif
/* No buffer, do as if we were seeking. */
if( !p_read )
{
/* seek within this stream if possible, else use plain old read and discard */
access_t *p_access = p_sys->p_access;
/* seeking after EOF is not what we want */
if( !( p_access->info.b_eof ) )
{
bool b_aseek;
access_Control( p_access, ACCESS_CAN_SEEK, &b_aseek );
if( b_aseek )
return AStreamSeekImmediate( s, p_sys->i_pos + i_read ) ? 0 : i_read;
}
}
/* First, check if we already have some data in the buffer,
* that we could copy directly */
int i_copy = __MIN( stream_buffered_size( s ), i_read );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment