[FFmpeg-trac] #8324(undetermined:new): signed integer overflow at libavfilter/vf_premultiply.c:212

FFmpeg trac at avcodec.org
Tue Oct 22 10:38:55 EEST 2019

#8324: signed integer overflow at libavfilter/vf_premultiply.c:212
             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:

 I compiled ffmpeg with "--toolchain=clang-usan" to check the undefined-
 behaviours and attached log file.
 How to reproduce:
 % ffmpeg_g -t 1 -y -i $PoC1 -i $PoC2 -filter_complex premultiply -target
 vcd -loglevel 0 tmp.hnm

 ffmpeg version N-95517-g0b8956b25c Copyright (c) 2000-2019 the FFmpeg
 built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
 configuration: --cc=clang --cxx=clang++ --ld=clang --enable-debug

 Here's UBSAN log

 libavfilter/vf_premultiply.c:212:44: runtime error: signed integer
 overflow: 61187 * 37008 cannot be represented in type 'int'
 [Switching to Thread 0x7fffdf7ee700 (LWP 1202)]

 Thread 37 "ffmpeg_g" hit Breakpoint 1, 0x00000000004288b0 in
 __ubsan::ScopedReport::~ScopedReport() ()
 (gdb) bt
 #0  0x00000000004288b0 in __ubsan::ScopedReport::~ScopedReport() ()
 #1  0x000000000042b0eb in void
 handleIntegerOverflowImpl<__ubsan::Value>(__ubsan::OverflowData*, unsigned
 long, char const*, __ubsan::Value, __ubsan::ReportOptions) ()
 #2  0x000000000042c9df in __ubsan_handle_mul_overflow ()
 #3  0x0000000000cdaf16 in premultiply16offset (mmsrc=<optimized out>,
 aasrc=<optimized out>,
     ddst=<optimized out>, mlinesize=<optimized out>, alinesize=<optimized
 out>, dlinesize=<optimized out>,
     w=60, h=1, half=32768, shift=16, offset=4096) at
 #4  0x0000000000cdd599 in premultiply_slice (ctx=<optimized out>,
 arg=<optimized out>, jobnr=<optimized out>,
     nb_jobs=<optimized out>) at libavfilter/vf_premultiply.c:390
 #5  0x00000000006635d5 in worker_func (priv=0x93cd600, jobnr=12,
 threadnr=<optimized out>,
     nb_jobs=<optimized out>, nb_threads=<optimized out>) at
 #6  0x00000000059e73e8 in run_jobs (ctx=0x93d0300) at
 #7  0x00000000059e61f6 in thread_worker (v=<optimized out>) at
 #8  0x00007ffff668e6db in start_thread (arg=0x7fffdf7ee700) at
 #9  0x00007ffff5d9388f in clone () at
 (gdb) q

 Please confirm.

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

More information about the FFmpeg-trac mailing list