mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-06 14:53:23 +00:00
avutil/libm: fix isnan compatibility hack
Commit 14ea4151d7
had a bug in that the
conversion of the uint64_t result to an int (the return signature) would
lead to implementation defined behavior, and in this case simply
returned 0 for NAN. A fix via AND'ing the result with 1 does the trick,
simply by ensuring a 0 or 1 return value.
Patch tested with FATE on x86-64, GNU/Linux by forcing the compatibility
code via an ifdef hack suggested by Michael.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
parent
4f99308ed3
commit
29af74e4e3
@ -123,7 +123,7 @@ static av_always_inline av_const int avpriv_isnan(double x)
|
|||||||
uint64_t v = av_double2int(x);
|
uint64_t v = av_double2int(x);
|
||||||
if ((v & 0x7ff0000000000000) != 0x7ff0000000000000)
|
if ((v & 0x7ff0000000000000) != 0x7ff0000000000000)
|
||||||
return 0;
|
return 0;
|
||||||
return v & 0x000fffffffffffff;
|
return (v & 0x000fffffffffffff) && 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define isnan(x) \
|
#define isnan(x) \
|
||||||
|
Loading…
Reference in New Issue
Block a user