• Ganesh Ajjanagadde's avatar
    avutil/libm: correct isnan, isinf compat hacks · 14ea4151
    Ganesh Ajjanagadde authored
    isnan and isinf are actually macros as per the standard. In particular,
    the existing implementation has incorrect signature. Furthermore, this
    results in undefined behavior for e.g double values outside float range
    as per the standard.
    
    This patch corrects the undefined behavior for all usage within FFmpeg.
    
    Note that long double is not handled as it is not used in FFmpeg.
    Furthermore, even if at some point long double gets used, it is likely
    not needed to modify the macro in practice for usage in FFmpeg. See
    below for analysis.
    
    Getting long double to work strictly per the spec is significantly harder
    since a long double may be an IEEE 128 bit quad (very rare), 80 bit
    extended precision value (on GCC/Clang), or simply double (on recent Microsoft).
    On the other hand, any potential future usage of long double is likely
    for precision (when a platform offers extra precision) and not for range, since
    the range anyway varies and is not as portable as IEEE 754 single/double
    precision. In such cases, the implicit cast to a double is well defined
    and isinf and isnan should work as intended.
    Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
    14ea4151
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
arch.mak Loading commit data...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
cmdutils_common_opts.h Loading commit data...
cmdutils_opencl.c Loading commit data...
common.mak Loading commit data...
configure Loading commit data...
ffmpeg.c Loading commit data...
ffmpeg.h Loading commit data...
ffmpeg_dxva2.c Loading commit data...
ffmpeg_filter.c Loading commit data...
ffmpeg_opt.c Loading commit data...
ffmpeg_qsv.c Loading commit data...
ffmpeg_vdpau.c Loading commit data...
ffmpeg_videotoolbox.c Loading commit data...
ffplay.c Loading commit data...
ffprobe.c Loading commit data...
ffserver.c Loading commit data...
ffserver_config.c Loading commit data...
ffserver_config.h Loading commit data...
library.mak Loading commit data...
version.sh Loading commit data...