[FFmpeg-devel] [PATCH 1/4] softfloat: handle INT32_MIN correctly in av_normalize1_sf

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun Nov 8 00:07:08 CET 2015


Otherwise a.mant=INT32_MIN triggers the av_assert2.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavutil/softfloat.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 00ff4a1..5fa5dc0 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -77,6 +77,10 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
     if((int32_t)(a.mant + 0x40000000U) <= 0){
         a.exp++;
         a.mant>>=1;
+        if(a.mant == -0x40000000){
+            a.exp++;
+            a.mant>>=1;
+        }
     }
     av_assert2(a.mant < 0x40000000 && a.mant > -0x40000000);
     return a;
-- 
2.6.2




More information about the ffmpeg-devel mailing list