mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-14 07:09:06 +00:00
av_d2q: Fix infinity check
The old check would fail on huge but not infinite values and the later code could then fail to handle them correctly in some cases. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8caf2da320
commit
de7d290631
@ -110,7 +110,7 @@ AVRational av_d2q(double d, int max)
|
||||
int64_t den;
|
||||
if (isnan(d))
|
||||
return (AVRational) { 0,0 };
|
||||
if (isinf(d))
|
||||
if (fabs(d) > INT_MAX + 3LL)
|
||||
return (AVRational) { d < 0 ? -1 : 1, 0 };
|
||||
exponent = FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);
|
||||
den = 1LL << (61 - exponent);
|
||||
|
Loading…
Reference in New Issue
Block a user