avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()

Otherwise the exponent could eventually underflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-11-08 13:25:54 +01:00
parent 107db5abf3
commit 0269fb11e3
1 changed files with 4 additions and 0 deletions

View File

@ -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;