[FFmpeg-trac] #2802(avformat:reopened): memory leak in avformat_find_stream_info

FFmpeg trac at avcodec.org
Tue Oct 26 19:48:22 EEST 2021


#2802: memory leak in avformat_find_stream_info
--------------------------------------+------------------------------------
             Reporter:  sean tearney  |                    Owner:  (none)
                 Type:  defect        |                   Status:  reopened
             Priority:  normal        |                Component:  avformat
              Version:  git-master    |               Resolution:
             Keywords:  leak          |               Blocked By:
             Blocking:                |  Reproduced by developer:  1
Analyzed by developer:  0             |
--------------------------------------+------------------------------------
Changes (by Bartek Zdanowski):

 * status:  closed => reopened
 * resolution:  fixed =>

Comment:

 This is very frustrating that you've closed this ticket. The bug still
 exists.
 Here you go: ffmpeg 4.2.4
 I'm reading a jpeg file, when using `avformat_find_stream_info()` it
 leaks.
 It's used as a library. Not from command line.
 Look at valgrind output - same as from 2013!


 {{{
 ==991786== 560,253 (24 direct, 560,229 indirect) bytes in 1 blocks are
 definitely lost in loss record 11 of 11
 ==991786==    at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-
 gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
 ==991786==    by 0x483E212: posix_memalign (in /usr/lib/x86_64-linux-
 gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
 ==991786==    by 0x37A642: av_malloc (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x37A8FD: av_mallocz (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x36FD09: av_buffer_create (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x370101: av_buffer_realloc (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x167C07: packet_alloc (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x167CED: av_new_packet (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x15DAC3: ff_img_read_packet (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x150C75: ff_read_packet (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x15131B: read_frame_internal (in
 /opt/workspace/cp/charlie_enc/build/encode_video)
 ==991786==    by 0x1535BD: avformat_find_stream_info (in
 /opt/workspace/cp/charlie_enc/build/encode_video)

 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/2802#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list