[FFmpeg-devel] [PATCH] libswscale: Fix the anonymous memory mapping in sws_GetContext for NetBSD when MMX2 optimisations are enabled.

Grant Carver grantc
Thu Aug 19 12:47:22 CEST 2010


> On Thu, Aug 19, 2010 at 08:19:24AM +0200, Grant Carver wrote:
> > Hi there
> >
> > Creation of a swscale context was failing on NetBSD due to the
> > anonymous mmap call failing. It seems that if the MAP_ANONYMOUS flag
> > is specified some BSD flavours require the file descriptor to be -1,
> > whilst on linux this parameter is just ignored.
> 
> where is this documented or is it a bug?

The man page for NetBSD
(http://netbsd.gw.com/cgi-bin/man-cgi?mmap++NetBSD-current) and FreeBSD
(http://nixdoc.net/man-pages/FreeBSD/mmap.2.html) contain the following:

----
mmap() will fail if:
....
[EINVAL]  MAP_FIXED was specified and the addr parameter was not
          page aligned or was outside of the valid address range
          for a process.  MAP_ANON was specified and fd was not
          -1.
----


> 
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Its not that you shouldnt use gotos but rather that you should write
> readable code and code with gotos often but not always is less readable






More information about the ffmpeg-devel mailing list