[FFmpeg-devel] [PATCH] Implement the function cmdutils.c:parse_int_or_die

D. Hugh Redelmeier hugh
Sun Feb 17 23:23:13 CET 2008

| From: Michael Niedermayer <michaelni at gmx.at>

| theres no need for both int and int64

Right.  long long could handle both.

| and the whole ERANGE thing is annoying, the max/min checks are enough

How is that?

If, for an O_INT64, I write
and INT64_MAX == LLONG_MAX (which is possible)
and the upper bound specified in the call is INT64_MAX
then the range check will not catch this.

The floating point case also suffers from this problem.

| and int64 will not be <INT64_MIN nor >INT64_MAX

The code uses long long.  lli might be <INT64_MIN or >INT64_MAX.

More information about the ffmpeg-devel mailing list