[FFmpeg-devel] [PATCH] Do not call lseek() with whence==AVSEEK_SIZE

Måns Rullgård mans
Sat Feb 13 17:24:11 CET 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Sat, Feb 13, 2010 at 03:12:38PM +0000, Mans Rullgard wrote:
>> ---
>>  libavformat/file.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>> 
>> diff --git a/libavformat/file.c b/libavformat/file.c
>> index d2cb530..2c14bb0 100644
>> --- a/libavformat/file.c
>> +++ b/libavformat/file.c
>> @@ -73,6 +73,8 @@ static int file_write(URLContext *h, unsigned char *buf, int size)
>>  static int64_t file_seek(URLContext *h, int64_t pos, int whence)
>>  {
>>      int fd = (intptr_t) h->priv_data;
>> +    if (whence == AVSEEK_SIZE)
>> +        return -1;
>
> ok with  ENOTSUP

Seeing avcoder's reply, maybe it would be better to check that whence
is one of the three standard values and reject everything else instead.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list