Opened 9 hours ago

Closed 8 hours ago

#11414 closed defect (invalid)

libavutil/mem.c:107:9 memory leaks

Reported by: 0x20z Owned by:
Priority: important Component: avutil
Version: git-master Keywords:
Cc: 0x20z Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Dear developers,
I have discovered a memory leaks vulnerability. The POC file is attached to the session, and the version of ffmpeg is the main branch. Please confirm.

How to reproduce:

git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
./configure --cc=clang --cxx=clang++ --toolchain=clang-asan --extra-cflags="-I$HOME/ffmpeg_build/include -O0 -fno-omit-frame-pointer -g"   --extra-cxxflags="-O0 -fno-omit-frame-pointer -g" --extra-ldflags="-L$HOME/ffmpeg_build/include -fsanitize=address -fsanitize=undefined -lubsan" --disable-optimizations --disable-stripping --enable-cross-compile
make -j30
./ffmpeg -y -i poc -c:v mpeg4 -c:a copy -f mp4 /dev/null

LeakSanitizer :

==422562==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x55f122751a47 in posix_memalign 
FFmpeg/ffmpeg+0x804a47) (BuildId: cb5cd0d261a2955cf44e6c06c3b59ca23341b342)
    #1 0x55f12732875f in av_malloc FFmpeg/libavutil/mem.c:107:9
    #2 0x55f123c453d3 in ff_interleave_add_packet FFmpeg/libavformat/mux.c:866:20
    #3 0x55f123c463bc in ff_interleave_packet_per_dts FFmpeg/libavformat/mux.c:971:20
    #4 0x55f123c49ed8 in interleaved_write_packet FFmpeg/libavformat/mux.c:1141:19
    #5 0x55f123c4de91 in write_packet_common FFmpeg/libavformat/mux.c:1172:16
    #6 0x55f123c49d88 in write_packets_common FFmpeg/libavformat/mux.c:1232:16
    #7 0x55f123c49dcc in av_interleaved_write_frame FFmpeg/libavformat/mux.c:1288:15
    #8 0x55f1227f800c in write_packet FFmpeg/fftools/ffmpeg_mux.c:236:11
    #9 0x55f1227f7ad3 in sync_queue_process FFmpeg/fftools/ffmpeg_mux.c:280:16
    #10 0x55f1227f2dac in mux_packet_filter FFmpeg/fftools/ffmpeg_mux.c:356:15
    #11 0x55f1227f1cd7 in muxer_thread FFmpeg/fftools/ffmpeg_mux.c:438:15
    #12 0x55f122844d7b in task_wrapper FFmpeg/fftools/ffmpeg_sched.c:2534:11
    #13 0x7fd97dc94ac2 in start_thread nptl/./nptl/pthread_create.c:442:8

Found by:

Found by 0x20z

Thank you for your time and attention

Change History (1)

comment:1 by 0x20z, 8 hours ago

Resolution: → invalid
Status: new → closed
Note: See TracTickets for help on using tickets.