[FFmpeg-devel] [PATCH] Fix yet another av_set_string() bug
Michael Niedermayer
michaelni
Wed May 14 16:14:39 CEST 2008
On Wed, May 14, 2008 at 03:56:04PM +0200, Stefano Sabatini wrote:
> On date Wednesday 2008-05-14 14:59:50 +0200, Michael Niedermayer encoded:
> > 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?
>
> I think av_set_number() already prints an appropriate error message (the
then the patch is ok
[...]
> The value for bt was -1 which is not within 1.000000 - inf
> ?
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
-------------- 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/b914a210/attachment.pgp>
More information about the ffmpeg-devel
mailing list