[FFmpeg-devel] [PATCH] raw_read_header fix

Michael Niedermayer michaelni
Sat Jul 14 13:55:47 CEST 2007


Hi

On Sat, Jul 14, 2007 at 12:41:13PM +0100, M?ns Rullg?rd wrote:
[...]
> >> > > nonsense, theres nothing invalid on an AVRational if these are false
> >> > 
> >> > Okay than av_rescale_q/rnd must be fixed to avoid crash with den=0.
> >> 
> >> no, i disagree, av_rescale rescales an integer, that cant work with den=0
> >> still this doesnt make x/0 invalid, its not a real number and calculations
> >> with it wont follow all the rules of a field but still handling it
> >> sanely (like most FPUs) makes sense IMHO
> >
> > Sure, but can you concentrate on the initial question? Can you fix this
> > issue in a way you prefer? Running seektest on ulaw/alaw (which is
> > enabled by default) causes division by zero.
> 
> Yes, please say how you'd like it.

there are many options

av_defined_q(r){
    return r.den || r.num;
}

or

av_isnan_q(r){
    return !(r.den || r.num);
}

and using one of them before risky uses of the timebase, this would assume
that all unknown timebases are 0/0 which makes sense from a mathematical POV

there are of course other options ...
though we should not silently treat nonsense timebases like -1/5 as nan

[...]
-- 
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: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070714/d77d9aa6/attachment.pgp>



More information about the ffmpeg-devel mailing list