summaryrefslogtreecommitdiffstats
path: root/libavutil/softfloat.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-08 13:25:54 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-08 13:39:06 +0100
commit0269fb11e3de17375f86d9120599af8c87cdfa0a (patch)
tree0b2571fd6ff62a8326a4f83e5d7e353f27c19a28 /libavutil/softfloat.h
parent107db5abf3211dc7579bbb67c1af5c25b0e280f6 (diff)
downloadffmpeg-streaming-0269fb11e3de17375f86d9120599af8c87cdfa0a.zip
ffmpeg-streaming-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>
Diffstat (limited to 'libavutil/softfloat.h')
-rw-r--r--libavutil/softfloat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 5335669..023ccd0 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;
OpenPOWER on IntegriCloud