[FFmpeg-trac] #6117(undetermined:new): type mismatch of AC3EncodeContext in different translation units

FFmpeg trac at avcodec.org
Wed Feb 1 12:55:18 EET 2017

#6117: type mismatch of AC3EncodeContext in different translation units
             Reporter:  dkrupp       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 Summary of the bug:
 While analyzing your project with clang I spotted the following problem.

 The struct AC3EncodeContext (defined in ac3enc.h) is defined differently
 depending on the CONFIG_AC3ENC_FLOAT macro.

 When compiling eac3enc.c the CONFIG_AC3ENC_FLOAT is 1, while in ac3enc.c
 it is 0.

 But there is a pass of this struct from in line 417 in ac3enc.c
     if (CONFIG_EAC3_ENCODER && s->eac3)
 The two translation units (TU) are linked together, and since the
 definition of the struct in the TUs are different, this could cause memory
 corruption problems when accessing its fields (and against the one
 definition rule).

 The potential bug still exists in commit

Ticket URL: <https://trac.ffmpeg.org/ticket/6117>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list