[Ffmpeg-devel] [C API] Add suport for ifstreams

Rich Felker dalias
Tue Sep 5 18:00:23 CEST 2006


On Tue, Sep 05, 2006 at 08:48:19AM +0200, Fran?????????? wrote:
> > On Mon, Sep 04, 2006 at 11:15:03PM +0100, M?ns Rullg?rd wrote:
> > > "Fran?ois Revol" <revol at free.fr> writes:
> > >
> > > > Another option is to add a custom protocol like ifstream: which
> > > > reads
> > > > the sting as the numeric value of a pointer, like
> > > > ifstream:0xdeadbeef.
> > >
> > > I can see this leading to some interesting possibilities for
> > > exploits.
> >
> > Only if the application lets users directly enter lavf protocol
> > strings.. However it does sound dangerous since http, etc. are
> > lavf protocols too right? Is there a way to do this more securely??
> >
> 
> Having an additionnal API allocate a cookie (arbitrary number), like
> ffifstream_allocate_urlcookie(), and use that as a once only key in
> url_open()...

Not an option, it's not thread-safe. Or is the caller required to wrap
the "get cookie" function with a lock?

IMO the solution is that you should be able to pass _either_ a
protocol string _or_ a pointer to a pre-configured context structure
to the open function instead of forcing everyone to use protocol
strings. This would eliminate the whole need to register custom
protocols for hacks like this.

Yes the same can be emulated by the calling app but it's silly for
every app that wants to do its own stream handling to have to make
such hacks..

Rich





More information about the ffmpeg-devel mailing list