1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-10-09 11:25:16 -04:00
parent 74a87ae210
commit 4c8ca76965

View File

@ -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;
}