[FFmpeg-trac] #8284(undetermined:new): memory leaks in fifo_alloc_common()
FFmpeg
trac at avcodec.org
Wed Oct 16 17:00:34 EEST 2019
#8284: memory leaks in fifo_alloc_common()
-------------------------------------+-------------------------------------
Reporter: Suhwan | Type: defect
Status: new | Priority: important
Component: | Version: git-
undetermined | master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
There are memory leaks in fifo_alloc_common()
How to reproduce:
{{{
%ffmpeg_g -stream_loop 23 -y -i $PoC1 -i $PoC2 -target svcd -loglevel 0
-psnr -c copy -c:s:9 ac3 -disposition:a:114 adpcm_adx tmp.mvi
ffmpeg version N-95389-gdd01947397 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
}}}
Here's Valgrind log
{{{
==48887== HEAP SUMMARY:
==48887== in use at exit: 88 bytes in 3 blocks
==48887== total heap usage: 667 allocs, 664 frees, 680,197 bytes
allocated
==48887==
==48887== 56 (40 direct, 16 indirect) bytes in 1 blocks are definitely
lost in loss record 3 of 3
==48887== at 0x9D3CE76: memalign (in /usr/lib/valgrind
/vgpreload_memcheck-amd64-linux.so)
==48887== by 0x9D3CF91: posix_memalign (in /usr/lib/valgrind
/vgpreload_memcheck-amd64-linux.so)
==48887== by 0x590EC79: av_malloc (mem.c:87)
==48887== by 0x590EC79: av_mallocz (mem.c:238)
==48887== by 0x58DA3AC: fifo_alloc_common (fifo.c:32)
==48887== by 0x175B433: mpeg_mux_init (mpegenc.c:461)
==48887== by 0x17BEA4D: avformat_write_header (mux.c:521)
==48887== by 0x4AB6CF: check_init_output_file (ffmpeg.c:2973)
==48887== by 0x4A830E: init_output_stream (ffmpeg.c:3631)
==48887== by 0x492E66: transcode_init (ffmpeg.c:3700)
==48887== by 0x48A1A5: transcode (ffmpeg.c:4653)
==48887== by 0x487D53: main (ffmpeg.c:4884)
==48887==
==48887== LEAK SUMMARY:
==48887== definitely lost: 40 bytes in 1 blocks
==48887== indirectly lost: 16 bytes in 1 blocks
==48887== possibly lost: 0 bytes in 0 blocks
==48887== still reachable: 32 bytes in 1 blocks
==48887== suppressed: 0 bytes in 0 blocks
==48887== Reachable blocks (those to which a pointer was found) are not
shown.
==48887== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==48887==
==48887== For counts of detected and suppressed errors, rerun with: -v
==48887== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
}}}
ASAN log
{{{
=================================================================
==34325==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x4de9e8 in posix_memalign (ffmpeg_asan+0x4de9e8)
#1 0x8594168 in av_malloc ffmpeg/libavutil/mem.c:87:9
#2 0x8594168 in av_mallocz ffmpeg/libavutil/mem.c:238
#3 0x852e42d in fifo_alloc_common ffmpeg/libavutil/fifo.c:32:9
Indirect leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x4de9e8 in posix_memalign (ffmpeg_asan+0x4de9e8)
#1 0x8593011 in av_malloc ffmpeg/libavutil/mem.c:87:9
#2 0x852e3f6 in av_fifo_alloc ffmpeg/libavutil/fifo.c:45:20
SUMMARY: AddressSanitizer: 56 byte(s) leaked in 2 allocation(s).
}}}
Please confirm.
Thanks
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8284>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list