Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#6685 closed defect (fixed)

Indirect function call with the wrong number of arguments in cmdutils.c

Reported by: Vedant Kumar Owned by:
Priority: minor Component: ffprobe
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm working on making clang's function sanitizer (a part of the undefined behavior sanitizer) support C programs. I tested my patch on ffmpeg + fate-suite and found a minor issue.

The DEFINE_OPT_SHOW_SECTION macro in ffprobe.c is used to define functions which accept two arguments. These functions are then stored into option defs. In cmdutils.c, they are called with three arguments (in write_option()).

One solution is to change the macro to add in an extra unused parameter (this silences the runtime warning).

Change History (3)

comment:1 by Balling, 4 years ago

Resolution: fixed
Status: newclosed

comment:2 by mkver, 4 years ago

Fixed in f2d522f2a88871ebd127b88169e22a6a7b6a81e5.
(I didn't know that this had been reported. My starting point for investigating and fixing this was that function pointers and void* pointers are not guaranteed to be convertible, so that one gets a warning from GCC and Clang when compiling with -pedantic.)

comment:3 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedffprobe
Note: See TracTickets for help on using tickets.