diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 13:25:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-08 13:39:06 +0100 |
commit | 0269fb11e3de17375f86d9120599af8c87cdfa0a (patch) | |
tree | 0b2571fd6ff62a8326a4f83e5d7e353f27c19a28 | |
parent | 107db5abf3211dc7579bbb67c1af5c25b0e280f6 (diff) | |
download | ffmpeg-0269fb11e3de17375f86d9120599af8c87cdfa0a.tar.gz |
avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()
Otherwise the exponent could eventually underflow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/softfloat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 53356697df..023ccd0930 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -181,6 +181,10 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val) val.mant >>= 1; val.exp = (val.exp >> 1) + 1; + if (val.exp < MIN_EXP) { + val.exp = MIN_EXP; + val.mant= 0; + } } return val; |