Opened 2 years ago

Closed 22 months ago

#5169 closed defect (fixed)

Memory leak in ebml_parse_elem()

Reported by: tsmith Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mkv leak regression
Cc: reimar Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Memory leak triggered while processing a webm file.

How to reproduce:

% ffmpeg -f webm -i test_case.webm -f null -

ffmpeg version N-77870-gb58cfa6 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --cc=gcc --cxx=g++ --disable-libxcb --disable-xlib --disable-logging --disable-ffprobe --disable-ffplay --disable-sdl --disable-ffserver --disable-doc --disable-pthreads --disable-stripping --disable-runtime-cpudetect
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 24.100 /  6. 24.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101

==21917==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2688 byte(s) in 1 object(s) allocated from:
    #0 0x5029b0 in realloc /home/user/Desktop/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:61
    #1 0x8e90ca in ebml_parse_elem /home/user/code/ffmpeg/libavformat/matroskadec.c:1075:19
    #2 0x8e83a1 in ebml_parse_id /home/user/code/ffmpeg/libavformat/matroskadec.c:954:12
    #3 0x8e83a1 in ebml_parse /home/user/code/ffmpeg/libavformat/matroskadec.c:970
    #4 0x8e9e27 in ebml_parse_nest /home/user/code/ffmpeg/libavformat/matroskadec.c:999:15
    #5 0x8e9e27 in ebml_parse_elem /home/user/code/ffmpeg/libavformat/matroskadec.c:1127
    #6 0x8e83a1 in ebml_parse_id /home/user/code/ffmpeg/libavformat/matroskadec.c:954:12
    #7 0x8e83a1 in ebml_parse /home/user/code/ffmpeg/libavformat/matroskadec.c:970
    #8 0x8dcf08 in matroska_read_header /home/user/code/ffmpeg/libavformat/matroskadec.c:2274:15
    #9 0xa86b59 in avformat_open_input /home/user/code/ffmpeg/libavformat/utils.c:482:20
    #10 0x53a764 in open_input_file /home/user/code/ffmpeg/ffmpeg_opt.c:950:11
    #11 0x538d01 in open_files /home/user/code/ffmpeg/ffmpeg_opt.c:2999:15
    #12 0x5385fc in ffmpeg_parse_options /home/user/code/ffmpeg/ffmpeg_opt.c:3036:11
    #13 0x55dd81 in main /home/user/code/ffmpeg/ffmpeg.c:4299:11
    #14 0x7fea45f1aec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

Indirect leak of 32 byte(s) in 8 object(s) allocated from:
    #0 0x5029b0 in realloc /home/user/Desktop/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:61
    #1 0x26e4e45 in av_realloc /home/user/code/ffmpeg/libavutil/mem.c:168:12
    #2 0x26e4e45 in av_strdup /home/user/code/ffmpeg/libavutil/mem.c:272
    #3 0x8e83a1 in ebml_parse_id /home/user/code/ffmpeg/libavformat/matroskadec.c:954:12
    #4 0x8e83a1 in ebml_parse /home/user/code/ffmpeg/libavformat/matroskadec.c:970
    #5 0x8e9e27 in ebml_parse_nest /home/user/code/ffmpeg/libavformat/matroskadec.c:999:15
    #6 0x8e9e27 in ebml_parse_elem /home/user/code/ffmpeg/libavformat/matroskadec.c:1127
    #7 0x8e83a1 in ebml_parse_id /home/user/code/ffmpeg/libavformat/matroskadec.c:954:12
    #8 0x8e83a1 in ebml_parse /home/user/code/ffmpeg/libavformat/matroskadec.c:970
    #9 0x8dcf08 in matroska_read_header /home/user/code/ffmpeg/libavformat/matroskadec.c:2274:15
    #10 0xa86b59 in avformat_open_input /home/user/code/ffmpeg/libavformat/utils.c:482:20
    #11 0x53a764 in open_input_file /home/user/code/ffmpeg/ffmpeg_opt.c:950:11
    #12 0x538d01 in open_files /home/user/code/ffmpeg/ffmpeg_opt.c:2999:15
    #13 0x5385fc in ffmpeg_parse_options /home/user/code/ffmpeg/ffmpeg_opt.c:3036:11
    #14 0x55dd81 in main /home/user/code/ffmpeg/ffmpeg.c:4299:11
    #15 0x7fea45f1aec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 2720 byte(s) leaked in 9 allocation(s).

Attachments (2)

test_case.webm (3.0 KB) - added by tsmith 2 years ago.
valgrind_log.txt (843 bytes) - added by tsmith 2 years ago.

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by tsmith

Changed 2 years ago by tsmith

comment:1 Changed 2 years ago by cehoyos

  • Keywords mkv leak regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

Regression since d493170e

comment:2 Changed 23 months ago by michael

  • Cc reimar added

adding author of commit d493170e to CC

comment:3 Changed 22 months ago by michael

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.