softfloat: handle -INT_MAX correctly
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sun, 13 Nov 2016 19:52:02 +0000 (20:52 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 26 Nov 2016 23:46:35 +0000 (00:46 +0100)
This is similar to commit 9ac61e73d0843ec4b83f4e3d47eded73234e406e.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 0edd569466eb45b134690b9f4efbb57eda86f58d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavutil/softfloat.h

index 7488753..c7b5a78 100644 (file)
@@ -154,7 +154,7 @@ static inline av_const SoftFloat av_sub_sf(SoftFloat a, SoftFloat b){
  */
 static inline av_const SoftFloat av_int2sf(int v, int frac_bits){
     int exp_offset = 0;
-    if(v == INT_MIN){
+    if(v <= INT_MIN + 1){
         exp_offset = 1;
         v>>=1;
     }