[FFmpeg-cvslog] ffserver_config: check for INT_MIN before doing FFABS

Ganesh Ajjanagadde git at videolan.org
Wed Oct 14 01:43:41 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Fri Oct  9 11:25:16 2015 -0400| [4c8ca76965b1c29758246624940cbc529e7141f0] | committer: Ganesh Ajjanagadde

ffserver_config: check for INT_MIN before doing FFABS

FFABS(INT_MIN) is not safe. Alternative of using FFNABS is not as
readable.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c8ca76965b1c29758246624940cbc529e7141f0
---

 ffserver_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 691ff7b..9fc1f00 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -460,7 +460,7 @@ static int ffserver_set_int_param(int *dest, const char *value, int factor,
     if (tmp < min || tmp > max)
         goto error;
     if (factor) {
-        if (FFABS(tmp) > INT_MAX / FFABS(factor))
+        if (tmp == INT_MIN || FFABS(tmp) > INT_MAX / FFABS(factor))
             goto error;
         tmp *= factor;
     }



More information about the ffmpeg-cvslog mailing list