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>
pull/264/head
Ganesh Ajjanagadde 9 years ago
parent 74a87ae210
commit 4c8ca76965
  1. 2
      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;
}

Loading…
Cancel
Save