[FFmpeg-trac] #8289(undetermined:new): left shift of 1 by 31 places cannot be represented in type 'int' at libavfilter/avf_abitscope.c:145

FFmpeg trac at avcodec.org
Wed Oct 16 18:55:32 EEST 2019


#8289: left shift of 1 by 31 places cannot be represented in type 'int' at
libavfilter/avf_abitscope.c:145
-------------------------------------+-------------------------------------
             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 a left shift of 1 by 31 places cannot be represented in type
 'int' at libavfilter/avf_abitscope.c:145

 I compiled ffmpeg with "--toolchain=clang-usan" to check the undefined-
 behaviours and attached log file.
 How to reproduce:
 {{{
 % ffmpeg_g -y -i $PoC -filter_complex abitscope -loglevel 0 tmp.rm

 ffmpeg version N-95399-g1a0c584abc 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/avf_abitscope.c:145:25: runtime error: left shift of 1 by 31
 places cannot be represented in type 'int'

 Thread 1 "ffmpeg_g" hit Breakpoint 1, 0x00000000004288b0 in
 __ubsan::ScopedReport::~ScopedReport() ()
 (gdb) bt
 #0  0x00000000004288b0 in __ubsan::ScopedReport::~ScopedReport() ()
 #1  0x000000000042a9a0 in
 handleShiftOutOfBoundsImpl(__ubsan::ShiftOutOfBoundsData*, unsigned long,
 unsigned long, __ubsan::ReportOptions) ()
 #2  0x000000000042cb41 in __ubsan_handle_shift_out_of_bounds ()
 #3  0x000000000050e01c in count_bits (s=0x9412b80, sample=4294967265,
 max=<optimized out>) at libavfilter/avf_abitscope.c:145
 #4  0x000000000050bcb7 in filter_frame (inlink=<optimized out>,
 insamples=<optimized out>) at libavfilter/avf_abitscope.c:203
 #5  activate (ctx=<optimized out>) at libavfilter/avf_abitscope.c:238
 #6  0x00000000005ce2ec in ff_filter_activate (filter=<optimized out>) at
 libavfilter/avfilter.c:1442
 #7  0x00000000005f42bf in push_frame (graph=0x93c6200) at
 libavfilter/buffersrc.c:187
 #8  av_buffersrc_add_frame_internal (ctx=<optimized out>, frame=0x9405640,
 flags=<optimized out>) at libavfilter/buffersrc.c:261
 #9  0x00000000005f2e7e in av_buffersrc_add_frame_flags (ctx=0x9413100,
 frame=0x9405640, flags=4) at libavfilter/buffersrc.c:170
 #10 0x00000000004cad60 in ifilter_send_frame (ifilter=<optimized out>,
 frame=<optimized out>) at fftools/ffmpeg.c:2186
 #11 send_frame_to_filters (ist=0x93b45c0, decoded_frame=0x9405400) at
 fftools/ffmpeg.c:2260
 #12 0x000000000049ba81 in decode_audio (ist=<optimized out>,
 pkt=<optimized out>, got_output=<optimized out>, decode_failed=<optimized
 out>) at fftools/ffmpeg.c:2327
 #13 process_input_packet (ist=<optimized out>, pkt=0x7fffffffc9b0,
 no_eof=0) at fftools/ffmpeg.c:2609
 #14 0x00000000004bf0f0 in process_input (file_index=<optimized out>) at
 fftools/ffmpeg.c:4508
 #15 0x000000000048d5eb in transcode_step () at fftools/ffmpeg.c:4628
 #16 transcode () at fftools/ffmpeg.c:4682
 #17 0x0000000000487da4 in main (argc=9, argv=<optimized out>) at
 fftools/ffmpeg.c:4884

 }}}
 Please confirm.
 Thanks

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


More information about the FFmpeg-trac mailing list