[FFmpeg-devel] bug in avoi.c, repost from ffmpeg-user at mplayerhq.hu

avcoder ffmpeg
Tue Feb 10 03:55:51 CET 2009


Dear:


On Thu, Feb 5, 2009 at 11:49 PM, Erik Van Grunderbeeck <erik at arawix.com>wrote:

> I think there's a file seek bug in libavformat\avio.c
> Line 94
>
>          if(!uc->is_streamed && url_seek(uc, 0, SEEK_SET) < 0)
>
> should read
>
>          if(!uc->is_streamed && up->url_seek(uc, 0, SEEK_SET) < 0)
>
> Not seeking on correct protocol will use the general seek, and thus the
> file
> handle is invalid. A windows debug build will assert there.
>

I think your modification is wrong!

What's the meaning of "general seek"?

you can not directly use up->url_seek() if up->url_seek is NULL

Please check url_seek() implementaion:

int64_t url_seek(URLContext *h, int64_t pos, int whence)
{
    int64_t ret;

    if (!h->prot->url_seek)
        return AVERROR(EPIPE);
    ret = h->prot->url_seek(h, pos, whence);
    return ret;
}


>


> Regards
>
> Erik
>
>
-- 
----------------------------------------------
Inspired by http://nextchat.mobi
Your potential. Our passion.




More information about the ffmpeg-devel mailing list