[vlc-devel] [PATCH] Bug fix: Do not close an http stream when seeking past the EOF

Bill C. Riemers briemers at redhat.com
Tue Jun 17 19:55:07 CEST 2008


Rémi Denis-Courmont wrote:
> Merged.
>
> Le mardi 17 juin 2008 19:15:42 Bill C. Riemers, vous avez écrit :
>   
>> The code in file.c (...) just tries the seek, and ignores the result.
>>     
>
> Yeah. That can only ever fail if the reader is stupid enough to try to seek 
> while CAN_SEEK is false, as far as I can tell though.
>
>   
Hmm.  The failure case in file.c is the module tries to seek past the
EOF.  In that case, since the stream is open read only the lseek returns
EINVAL.  The location of the file pointer is left at it's previous
position, and p_access->info.i_pos says it is past the EOF location. 
I'm surprised this doesn't cause really bad things to happen...

BTW.  It just occurred to me.  Shouldn't file.c be using lseek64, not lseek?

Bill





More information about the vlc-devel mailing list