Commit 4c8ca769 authored by Ganesh Ajjanagadde's avatar 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 74a87ae2
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment