diff --git a/libmpdemux/ebml.c b/libmpdemux/ebml.c index af69e61aaf..df1fda647b 100644 --- a/libmpdemux/ebml.c +++ b/libmpdemux/ebml.c @@ -13,6 +13,7 @@ #include "ebml.h" #include "libavutil/common.h" #include "libavutil/bswap.h" +#include "libavutil/intfloat_readwrite.h" #ifndef SIZE_MAX @@ -179,20 +180,12 @@ ebml_read_float (stream_t *s, uint64_t *length) switch (len) { case 4: - { - union {uint32_t i; float f;} u; - u.i = stream_read_dword (s); - value = u.f; + value = av_int2flt(stream_read_dword(s)); break; - } case 8: - { - union {uint64_t i; double d;} u; - u.i = stream_read_qword (s); - value = u.d; + value = av_int2dbl(stream_read_qword(s)); break; - } default: return EBML_FLOAT_INVALID;