[FFmpeg-trac] #8250(undetermined:new): heap-buffer-overflow at libavfilter/vf_colorconstancy.c:282

FFmpeg trac at avcodec.org
Fri Oct 11 07:35:37 EEST 2019

#8250: heap-buffer-overflow at libavfilter/vf_colorconstancy.c:282
             Reporter:  Suhwan       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  asan         |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 Summary of the bug:
 There is a heap-buffer-overflow at libavfilter/vf_colorconstancy.c:282 in
 I compiled ffmpeg with "--toolchain=clang-asan" to check the memory
 corruption and attached log file.

 How to reproduce:
 % ffmpeg_g -t 2 -y -r 38 -i $PoC -filter_complex greyedge -target dv
 -loglevel 99 -map 0 -c:v:102 sgi -disposition:a:131 pam -disposition:s:1
 vc2 -r 100 -ab 579k -ar 48000 tmp.avs2

 ffmpeg version N-95314-g1331e00179 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 ASAN log

 ==35623==ERROR: AddressSanitizer: heap-buffer-overflow on address
 0x60a000000a38 at pc 0x000000b2885c bp 0x7ffff172cb60 sp 0x7ffff172cb58
 READ of size 8 at 0x60a000000a38 thread T1
     #0 0xb2885b in slice_get_derivative
     #1 0x9429d9 in worker_func ffmpeg/libavfilter/pthread.c:50:15
     #2 0x8658de2 in run_jobs ffmpeg/libavutil/slicethread.c:61:9
     #3 0x865674d in thread_worker ffmpeg/libavutil/slicethread.c:85:13
     #4 0x4eb9de in __asan::AsanThread::ThreadStart(unsigned long,
 __sanitizer::atomic_uintptr_t*) (ffmpeg/ffmpeg_g+0x4eb9de)
     #5 0x7ffff668e6da in start_thread (/lib/x86_64-linux-
     #6 0x7ffff5d9388e in clone /build/glibc-

 0x60a000000a38 is located 8 bytes to the left of 56-byte region
 allocated by thread T0 here:
     #0 0x4de9e8 in posix_memalign (ffmpeg/ffmpeg_g+0x4de9e8)
     #1 0x8565daa in av_malloc ffmpeg/libavutil/mem.c:87:9
     #2 0x8565daa in av_mallocz ffmpeg/libavutil/mem.c:238
     #3 0x8565daa in av_mallocz_array ffmpeg/libavutil/mem.c:195
     #4 0xb1cdc0 in set_gauss ffmpeg/libavfilter/vf_colorconstancy.c:119:23
     #5 0xb1cdc0 in config_props ffmpeg/libavfilter/vf_colorconstancy.c:666

 Thread T1 created by T0 here:
     #0 0x436f80 in pthread_create (ffmpeg/ffmpeg_g+0x436f80)
     #1 0x8655939 in avpriv_slicethread_create

 SUMMARY: AddressSanitizer: heap-buffer-overflow
 ffmpeg/libavfilter/vf_colorconstancy.c:282:53 in slice_get_derivative

 Please confirm.

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

More information about the FFmpeg-trac mailing list