diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 13:59:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 14:23:38 +0100 |
commit | 046218b212a076b92ed88a280457db871dafd377 (patch) | |
tree | 71718e63b59a1f386e571e59d3b4846a5b34ed0f | |
parent | a1e3303fc01b95623d7a6963686c81b076690efd (diff) | |
download | ffmpeg-046218b212a076b92ed88a280457db871dafd377.tar.gz |
avutil/softfloat: Fix exponent underflow in av_div_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/softfloat.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index e47420e999..e5bfbbdfc6 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -111,7 +111,10 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){ static inline av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){ a.exp -= b.exp; a.mant = ((int64_t)a.mant<<(ONE_BITS+1)) / b.mant; - return av_normalize1_sf(a); + a = av_normalize1_sf(a); + if (!a.mant || a.exp < MIN_EXP) + return FLOAT_0; + return a; } static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){ |