[FFmpeg-devel] [PATCH] urlconcat protocol

Michele Orrù maker.py
Fri Feb 5 12:39:32 CET 2010


2010/2/5 Michael Niedermayer <michaelni at gmx.at>

> On Fri, Feb 05, 2010 at 08:07:50AM +0100, Michele Orr? wrote:
> > >
> > > trailing whitespace is forbidden in our svn
> > > maybe you want to try our patcheck script (see tools directory in svn)
> > >
> > ok, done,
> >
> >
> > > > +    if (err < 0)
> > > > +        urlconcat_close(h);
> > > > +    else
> > > > +        unodes = av_realloc(unodes, udata->length *
> sizeof(*unodes));
> > > > +    return err;
> > >
> > > the new array isnt stored anywhere and the failure cases is not handled
> > >
> > > Nope.
> >  At line 75 we make an an an array enough long to contain all urls , but
> > using as size as many times AV_CAT_SEPARATOR is present on *uri (+1).
> >  At line 100, instead, we move to the next url (uri += len + strspn()).
> So,
> > strings like cat:foo||bar are accepted.
> >
> >  In the end, we realloc *nodes in order to free all the useless space
> that
> > could be allocated due to multiple consecutive AV_CAT_SEPARATOR. But,
> it's
> > obviuos that this new size is less than the original size. So, why manage
> > the case of failure?
>
> Nothing gurantees that a realloc() reducing the size of an array succeed
> And id be surprised if there is no place where realloc() is implemented as
> a malloc();memcpy();free(); which certainly can fail
>
> also the smaller unodes may be at a different place in memory
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The real ebay dictionary, page 1
> "Used only once"    - "Some unspecified defect prevented a second use"
> "In good condition" - "Can be repaird by experienced expert"
> "As is" - "You wouldnt want it even if you were payed for it, if you knew
> ..."
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFLa/qHYR7HhwQLD6sRAmMVAJ98iAYzBze99U3O2LSAp?????
> zMphhverHy6ok9PgeHLmUtc=
> =tROc
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>

okok, fixed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uconcatp.patch
Type: application/octet-stream
Size: 6797 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100205/17e4e810/attachment.obj>



More information about the ffmpeg-devel mailing list