avcfg: Ensure that ternary operator always evaluates to int64
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 15 Oct 2018 22:38:57 +0000 (04:08 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Mon, 15 Oct 2018 22:59:37 +0000 (04:29 +0530)
commit21a18e22e141ca01d4e23517c813ea45a7d701db
treefd306c382feb3facb7defda87ca885627a521e3c
parentef106350d4837d9509a636491c723fc5aae8df96
avcfg: Ensure that ternary operator always evaluates to int64

When building with MSVC, if the 3rd operator is a double, the entire
expression always promoted double, and is then cast to int64.

When TRUE, this evaluates to (gint64) (gdouble) (INT64_MAX)
which overflows to INT64_MIN on MSVC, but not on C99 compilers.

This causes us to fail the g_return_if_fail inside g_param_spec_int64
when built with MSVC.
ext/libav/gstavcfg.c