1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2026-05-16 08:38:24 +02:00

softfloat: assert when the argument of av_sqrt_sf is negative

The correct result can't be expressed in SoftFloat.
Currently it returns a random value from an out of bounds read.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f3866a14c3)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun
2015-11-08 15:15:24 +01:00
parent c4133b25f8
commit 510d88ae93
+2
View File
@@ -179,6 +179,8 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val)
if (val.mant == 0)
val.exp = MIN_EXP;
else if (val.mant < 0)
av_assert0(0);
else
{
tabIndex = (val.mant - 0x20000000) >> 20;