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

Michael Niedermayer michaelni
Mon Jul 5 01:16:07 CEST 2010


On Sun, Jun 27, 2010 at 03:08:51PM -0700, Eli Friedman 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).
> 
> -Eli

> Index: libavformat/aviobuf.c
> ===================================================================
> --- libavformat/aviobuf.c	(revision 23833)
> +++ libavformat/aviobuf.c	(working copy)
> @@ -605,8 +605,7 @@
>  #endif
>  {
>  #if LIBAVFORMAT_VERSION_MAJOR < 53
> -    URLContext *h = s->opaque;
> -    if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR))
> +    if (flags & URL_RDWR)
>          return AVERROR(EINVAL);

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100705/4733d4cf/attachment.pgp>



More information about the ffmpeg-devel mailing list