]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_lut3d: fix sanitizef INF handling
authorMark Reid <mindmark@gmail.com>
Mon, 9 Nov 2020 01:12:29 +0000 (17:12 -0800)
committerAnton Khirnov <anton@khirnov.net>
Fri, 20 Nov 2020 14:20:24 +0000 (15:20 +0100)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavfilter/vf_lut3d.c

index 988f6c8b551ede23e4bac43761084a296bf1f44a..172d6df0c8a3d3839120ac363bb4efc2bc62fadc 100644 (file)
@@ -107,7 +107,7 @@ typedef struct ThreadData {
 
 #define EXPONENT_MASK 0x7F800000
 #define MANTISSA_MASK 0x007FFFFF
-#define SIGN_MASK     0x7FFFFFFF
+#define SIGN_MASK     0x80000000
 
 static inline float sanitizef(float f)
 {
@@ -120,7 +120,7 @@ static inline float sanitizef(float f)
             return 0.0f;
         } else if (t.i & SIGN_MASK) {
             // -INF
-            return FLT_MIN;
+            return -FLT_MAX;
         } else {
             // +INF
             return FLT_MAX;