[FFmpeg-devel] stlport with ffmpeg: Issue with time_is_forbidden_due_to_security_issues

Raymond Toy rtoy at google.com
Thu Sep 13 01:20:27 CEST 2012


On Wed, Sep 12, 2012 at 3:28 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> On Thursday 13 September 2012 12:13:44 am Reimar Döffinger wrote:
> > On 12 Sep 2012, at 21:02, Raymond Toy <rtoy at google.com> wrote:
> > > I'm currently building ffmpeg on Android and it pretty much works, but
> > > I've run into a problem with ffmpeg's time and stlport.
> > >
> > > In internal.h, ffmpeg has
> > >
> > > #undef time
> > > #define time time_is_forbidden_due_to_security_issues
> > >
> > > In various ffmpeg files, there is
> > >
> > > #include <time.h>
> > >
> > > When building ffmpeg on my Android system, the stlport version of
> time.h,
> > > which basically does something like
> > >
> > > #define _STLP_NATIVE_C_HEADER(header) <../include/header>
> > > #include _STLP_NATIVE_C_HEADER(time.h)
> > >
> > > Because of the #define in internal.h  this gets expanded as
> > >
> > > #include <../include/time_is_forbidden_due_to_security_issues.h>
> > >
> > > That file, of course, doesn't exist.  I assume the intent of the #undef
> > > and #define is to prevent uses of the function time, not to prevent
> > > including <time.h>. I'm currently getting around this be removing the
> > > #define from internal.h so that I can continue my development, but that
> > > is not the right solution.
> > >
> > > Any suggestions on how to solve this?
> >
> > System headers should be included before FFmpeg headers for exactly this
> >  reason (with the exception of config.h, which we need to figure out
> >  whether we can include certain system headers, but should not cause that
> >  kind of issue).
>
> Untested patch attached.
>

Thanks for the patch.  It seems the idea is right, but it's much more
compilicated than that.  For example libavformat/mov.c includes avformat.h,
which includes <time.h>.  And vp8.c includes vp8.h which includes
<pthreads.h> and stlport pthreads.h includes <time.h>

I can work on some patch to take care of this, but it seems that it would
be pretty messy to have to move all of the various system includes buried
in header files to the c files.  Some guidance on what would be acceptable
would be helpful.

Ray


More information about the ffmpeg-devel mailing list