[FFmpeg-devel] [PATCH] fix two checks in ffserver.c

Erik Hovland erik
Wed Jun 18 23:49:45 CEST 2008


On Wed, Jun 18, 2008 at 02:31:16PM -0700, Baptiste Coudurier wrote:
> Hi,
> 
> Stefan Gehrer wrote:
> > Erik Hovland wrote:
> >> There are a couple of erroneous checks in ffserver.c. One is to see if
> >> open() worked. The other is to check the validity of a string.
> > 
> >  > diff --git a/ffserver.c b/ffserver.c
> >  > index 5464176..6495f9a 100644
> >  > --- a/ffserver.c
> >  > +++ b/ffserver.c
> >  > @@ -392,7 +392,7 @@ static void start_children(FFStream *feed)
> >  >
> >  >                  if (!ffserver_debug) {
> >  >                      i = open("/dev/null", O_RDWR);
> >  > -                    if (i)
> >  > +                    if (i >= 0)
> >  >                          dup2(i, 0);
> >  >                      dup2(i, 1);
> >  >                      dup2(i, 2);
> > 
> > 
> > This looks good to me, at least my 'man 3 open' confirms this.
> > 
> 
> Here it is man 2 open.
> Besides, there is some if (i) two lines after too, and I think check
> should be done against -1.

You are so right. Extended patch attached.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffserver.c-fix-checks.patch
Type: text/x-diff
Size: 1210 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080618/1ff2f103/attachment.patch>



More information about the ffmpeg-devel mailing list