Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8346 closed defect (fixed)

memory leaks in ff_inlink_consume_samples()

Reported by: Suhwan Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: afade leak
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
There are memory leaks in ff_inlink_consume_samples()
How to reproduce:

% ffmpeg_g -t 3 -stream_loop 5 -y -i $PoC1 -i $PoC2 -filter_complex acrossfade -loglevel 0 -map 0 -aframes 13 tmp.flac

commit 648b422e171d5eab18f6c6fd346e4050d717b936
ffmpeg version N-95601-g648b422e17 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

==45601== HEAP SUMMARY:
==45601==     in use at exit: 89,016 bytes in 7 blocks
==45601==   total heap usage: 2,133 allocs, 2,126 frees, 12,703,359 bytes allocated
==45601== 
==45601== 88,984 (536 direct, 88,448 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 7
==45601==    at 0xA031E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==45601==    by 0xA031F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==45601==    by 0x59642E9: av_malloc (mem.c:87)
==45601==    by 0x59642E9: av_mallocz (mem.c:238)
==45601==    by 0x593847D: av_frame_alloc (frame.c:191)
==45601==    by 0x64FDA5: ff_frame_pool_get (framepool.c:201)
==45601==    by 0x509614: ff_default_get_audio_buffer (audio.c:73)
==45601==    by 0x5D120F: take_samples (avfilter.c:1181)
==45601==    by 0x5D120F: ff_inlink_consume_samples (avfilter.c:1525)
==45601==    by 0x106AC12: activate (af_afade.c:456)
==45601==    by 0x5CE4BB: ff_filter_activate (avfilter.c:1442)
==45601==    by 0x5F4C6A: push_frame (buffersrc.c:187)
==45601==    by 0x5F4C6A: av_buffersrc_close (buffersrc.c:275)
==45601==    by 0x4A1541: ifilter_send_eof (ffmpeg.c:2204)
==45601==    by 0x4A1541: send_filter_eof (ffmpeg.c:2553)
==45601==    by 0x4A1541: process_input_packet (ffmpeg.c:2692)
==45601==    by 0x48EED6: transcode (ffmpeg.c:4700)
==45601== 
==45601== LEAK SUMMARY:
==45601==    definitely lost: 536 bytes in 1 blocks
==45601==    indirectly lost: 88,448 bytes in 5 blocks
==45601==      possibly lost: 0 bytes in 0 blocks
==45601==    still reachable: 32 bytes in 1 blocks
==45601==         suppressed: 0 bytes in 0 blocks
==45601== Reachable blocks (those to which a pointer was found) are not shown.
==45601== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==45601== 
==45601== For counts of detected and suppressed errors, rerun with: -v
==45601== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Please confirm.
Thanks

Attachments (2)

PoC_1.wav (125.0 KB ) - added by Suhwan 4 years ago.
poc1
PoC_2.wav (125.0 KB ) - added by Suhwan 4 years ago.
poc2

Download all attachments as: .zip

Change History (4)

by Suhwan, 4 years ago

Attachment: PoC_1.wav added

poc1

by Suhwan, 4 years ago

Attachment: PoC_2.wav added

poc2

comment:1 by James, 4 years ago

Component: undeterminedavfilter
Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 4 years ago

Keywords: afade leak added
Note: See TracTickets for help on using tickets.