[FFmpeg-cvslog] avutil/softfloat: Fix exponent underflow in av_mul_sf()
Michael Niedermayer
git at videolan.org
Thu Nov 12 00:24:07 CET 2015
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov 8 13:57:19 2015 +0100| [402c4a9f81de2c2329b6de4a0fb991253e098cbc] | committer: Michael Niedermayer
avutil/softfloat: Fix exponent underflow in av_mul_sf()
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a1e3303fc01b95623d7a6963686c81b076690efd)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=402c4a9f81de2c2329b6de4a0fb991253e098cbc
---
libavutil/softfloat.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index fcad0f0..e47420e 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -98,7 +98,10 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
a.exp += b.exp;
av_assert2((int32_t)((a.mant * (int64_t)b.mant) >> ONE_BITS) == (a.mant * (int64_t)b.mant) >> ONE_BITS);
a.mant = (a.mant * (int64_t)b.mant) >> ONE_BITS;
- return av_normalize1_sf((SoftFloat){a.mant, a.exp - 1});
+ a = av_normalize1_sf((SoftFloat){a.mant, a.exp - 1});
+ if (!a.mant || a.exp < MIN_EXP)
+ return FLOAT_0;
+ return a;
}
/**
More information about the ffmpeg-cvslog
mailing list