[FFmpeg-cvslog] avutil/softfloat: Fix exponent underflow in av_div_sf()

Michael Niedermayer git at videolan.org
Sun Nov 8 14:29:26 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  8 13:59:21 2015 +0100| [046218b212a076b92ed88a280457db871dafd377] | committer: Michael Niedermayer

avutil/softfloat: Fix exponent underflow in av_div_sf()

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

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

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

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index e47420e..e5bfbbd 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -111,7 +111,10 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
 static inline av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){
     a.exp -= b.exp;
     a.mant = ((int64_t)a.mant<<(ONE_BITS+1)) / b.mant;
-    return av_normalize1_sf(a);
+    a = av_normalize1_sf(a);
+    if (!a.mant || a.exp < MIN_EXP)
+        return FLOAT_0;
+    return a;
 }
 
 static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){



More information about the ffmpeg-cvslog mailing list