[FFmpeg-cvslog] avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()

Michael Niedermayer git at videolan.org
Sun Nov 8 13:42:11 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  8 13:25:54 2015 +0100| [0269fb11e3de17375f86d9120599af8c87cdfa0a] | committer: Michael Niedermayer

avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()

Otherwise the exponent could eventually underflow

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0269fb11e3de17375f86d9120599af8c87cdfa0a
---

 libavutil/softfloat.h |    4 ++++
 1 file changed, 4 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list