[FFmpeg-devel] [PATCH] Fix yet another av_set_string() bug
Michael Niedermayer
michaelni
Wed May 14 13:13:12 CEST 2008
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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/1486653e/attachment.pgp>
More information about the ffmpeg-devel
mailing list