Opened 2 years ago

Closed 3 months ago

Last modified 3 months ago

#6685 closed defect (fixed)

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

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


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 Changed 3 months ago by Balling

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 3 months ago by mkver

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 Changed 3 months ago by cehoyos

  • Component changed from undetermined to ffprobe
Note: See TracTickets for help on using tickets.