summaryrefslogtreecommitdiffstats
path: root/libavutil/softfloat.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-08 13:57:19 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-08 14:23:38 +0100
commita1e3303fc01b95623d7a6963686c81b076690efd (patch)
tree34bc7d9c785fae41eba28c17f0815b19bd1f6e88 /libavutil/softfloat.h
parent4135a2bfd6d0a835f57031de57ae42363d455574 (diff)
downloadffmpeg-streaming-a1e3303fc01b95623d7a6963686c81b076690efd.zip
ffmpeg-streaming-a1e3303fc01b95623d7a6963686c81b076690efd.tar.gz
avutil/softfloat: Fix exponent underflow in av_mul_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/softfloat.h')
-rw-r--r--libavutil/softfloat.h5
1 files changed, 4 insertions, 1 deletions
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;
}
/**
OpenPOWER on IntegriCloud