[FFmpeg-devel] [PATCH] Fix yet another av_set_string() bug
Michael Niedermayer
michaelni
Wed May 14 14:59:50 CEST 2008
On Wed, May 14, 2008 at 02:45:24PM +0200, Stefano Sabatini wrote:
> On date Wednesday 2008-05-14 13:13:12 +0200, Michael Niedermayer encoded:
> > On Wed, May 14, 2008 at 01:03:40PM +0200, Stefano Sabatini wrote:
> > > Hi all,
> > >
> > > when the av_set_number() is called with a parsable yet not valid
> > > (e.g. out of range) value then av_set_string() should return NULL.
> > >
> > > Check the bug for example with:
> > > ffmpeg -bt -1000
> > >
> > > Regards.
> > > --
> > > FFmpeg = Fiendish and Fast MultiPurpose EnGine
> >
> > > Index: libavcodec/opt.c
> > > ===================================================================
> > > --- libavcodec/opt.c (revision 13153)
> > > +++ libavcodec/opt.c (working copy)
> > > @@ -182,9 +182,9 @@
> > > }else if(cmd=='-')
> > > d= -d;
> > >
> > > - av_set_number(obj, name, d, 1, 1);
> > > + o= av_set_number(obj, name, d, 1, 1);
> > > val+= i;
> > > - if(!*val)
> > > + if(!*val || !o)
> > > return o;
> >
> > rejected, you misuse o as a temporary variable
>
> OK, check this one.
What about printing an appropriate error message?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080514/16772e29/attachment.pgp>
More information about the ffmpeg-devel
mailing list