[FFmpeg-devel] [PATCH] Fix warning in url_resetbuf (in aviobuf.c)

Eli Friedman eli.friedman
Sat Jul 3 08:43:08 CEST 2010


On Sun, Jun 27, 2010 at 3:08 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> 2010/6/27 M?ns Rullg?rd <mans at mansr.com>:
>> Eli Friedman <eli.friedman at gmail.com> writes:
>>
>>> Patch attached; note that there isn't any functionality change because
>>> URL_RDWR is 2, which makes the entire RHS of the || collapse to 0.
>>>
>>> -Eli
>>>
>>> Index: libavformat/aviobuf.c
>>> ===================================================================
>>> --- libavformat/aviobuf.c ? ? (revision 23833)
>>> +++ libavformat/aviobuf.c ? ? (working copy)
>>> @@ -606,7 +606,7 @@
>>> ?{
>>> ?#if LIBAVFORMAT_VERSION_MAJOR < 53
>>> ? ? ?URLContext *h = s->opaque;
>>> - ? ?if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR))
>>
>> That last bit of that expression should obviously be !(h->flags & URL_RDWR),
>>
>>> + ? ?if (flags & URL_RDWR)
>>> ? ? ? ? ?return AVERROR(EINVAL);
>>
>> so this change is probably not correct.
>
> Actually, I think the check was never correct... see
> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/077001.html
> .
>
> New version attached which also eliminates the unused variable (I
> didn't spot it originally because there are other warnings in the
> file).

Ping.

-Eli



More information about the ffmpeg-devel mailing list