[FFmpeg-trac] #8307(undetermined:new): outside the range of representable values of type 'int' at libavfilter/af_drmeter.c

FFmpeg trac at avcodec.org
Fri Oct 18 16:43:34 EEST 2019


#8307: outside the range of representable values of type 'int' at
libavfilter/af_drmeter.c
-------------------------------------+-------------------------------------
             Reporter:  Suhwan       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  ubsan        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 There is an outside the range of representable values of type 'int' at
 libavfilter/af_drmeter.c and 2 integer division by zero.

 I compiled ffmpeg with "--toolchain=clang-usan" to check the undefined-
 behaviours and attached log file.
 How to reproduce:
 {{{
 % ffmpeg_g -y -i $PoC1 -i $PoC2 -filter_complex drmeter -target dv50
 -loglevel 0 tmp.rtp

 ffmpeg version N-95446-gfddef964e8 Copyright (c) 2000-2019 the FFmpeg
 developers
 built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
 configuration: --cc=clang --cxx=clang++ --ld=clang --enable-debug
 --toolchain=clang-usan
 }}}

 Here's UBSAN log

 {{{
 libavfilter/af_drmeter.c:104:27: runtime error: division by zero

 Thread 1 "ffmpeg_g" hit Breakpoint 1, 0x00000000004288b0 in
 __ubsan::ScopedReport::~ScopedReport() ()
 (gdb) bt
 #0  0x00000000004288b0 in __ubsan::ScopedReport::~ScopedReport() ()
 #1  0x0000000000429b4e in handleDivremOverflowImpl(__ubsan::OverflowData*,
 unsigned long, unsigned long, __ubsan::ReportOptions) ()
 #2  0x000000000042cad1 in __ubsan_handle_divrem_overflow ()
 #3  0x00000000011b6dcf in finish_block (p=0x7ffff7fc4040)
     at libavfilter/af_drmeter.c:104
 #4  0x00000000011b4f03 in print_stats (ctx=<optimized out>)
     at libavfilter/af_drmeter.c:170
 #5  uninit (ctx=0x93b4200) at libavfilter/af_drmeter.c:202
 #6  0x00000000005ca203 in avfilter_free (filter=0x93b4200)
     at libavfilter/avfilter.c:771
 #7  0x00000000005d61b8 in avfilter_graph_free (graph=0x93b1890)
     at libavfilter/avfiltergraph.c:126
 #8  0x00000000004881bb in ffmpeg_cleanup (ret=0) at fftools/ffmpeg.c:494
 #9  0x00000000004744d3 in exit_program (ret=0) at fftools/cmdutils.c:139
 #10 0x0000000000487f5f in main (argc=<optimized out>, argv=<optimized
 out>)
     at fftools/ffmpeg.c:4901
 (gdb) c
 Continuing.
 libavfilter/af_drmeter.c:106:23: runtime error: -nan is outside the range
 of representable values of type 'int'

 Thread 1 "ffmpeg_g" hit Breakpoint 1, 0x00000000004288b0 in
 __ubsan::ScopedReport::~ScopedReport() ()
 (gdb) bt
 #0  0x00000000004288b0 in __ubsan::ScopedReport::~ScopedReport() ()
 #1  0x000000000042a4e6 in handleFloatCastOverflow(void*, unsigned long,
 __ubsan::ReportOptions) ()
 #2  0x000000000042cd11 in __ubsan_handle_float_cast_overflow ()
 #3  0x00000000011b6eaa in finish_block (p=0x7ffff7fc4040)
     at libavfilter/af_drmeter.c:106
 #4  0x00000000011b4f03 in print_stats (ctx=<optimized out>)
     at libavfilter/af_drmeter.c:170
 #5  uninit (ctx=0x93b4200) at libavfilter/af_drmeter.c:202
 #6  0x00000000005ca203 in avfilter_free (filter=0x93b4200)
     at libavfilter/avfilter.c:771
 #7  0x00000000005d61b8 in avfilter_graph_free (graph=0x93b1890)
     at libavfilter/avfiltergraph.c:126
 #8  0x00000000004881bb in ffmpeg_cleanup (ret=0) at fftools/ffmpeg.c:494
 #9  0x00000000004744d3 in exit_program (ret=0) at fftools/cmdutils.c:139
 #10 0x0000000000487f5f in main (argc=<optimized out>, argv=<optimized
 out>)
     at fftools/ffmpeg.c:4901
 (gdb) c
 Continuing.
 libavfilter/af_drmeter.c:189:38: runtime error: division by zero

 Thread 1 "ffmpeg_g" hit Breakpoint 1, 0x00000000004288b0 in
 __ubsan::ScopedReport::~ScopedReport() ()
 (gdb) q

 }}}
 Please confirm.
 Thanks

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


More information about the FFmpeg-trac mailing list