[FFmpeg-trac] #2529(avcodec:reopened): Memory leaks in aac decode

FFmpeg trac at avcodec.org
Mon May 6 22:49:15 CEST 2013


#2529: Memory leaks in aac decode
------------------------------------+------------------------------------
             Reporter:  wolenetz    |                    Owner:
                 Type:  defect      |                   Status:  reopened
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  aac leak    |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by wolenetz):

 With current git-master, I've done some investigating and it looks like
 the ac->frame buffers that frame_configure_elements() gets from
 ff_get_buffer() are leaked when the next log message is "Multiple frames
 in a packet from stream 0".  Furthermore, one of those frames contains
 references apparently to a couple new frames that
 frame_configure_elements() on its next call gets from ff_get_buffer(),
 even though those latter frames are eventually unref'ed() once.  I hope
 this helps narrow down the search for a fix.  Details ("[LEAKED...]"
 comments are mine, line numbers may be off slightly due to private debug
 log msg additions):

 ==31122== 33,088 (+33,088) (48 (+48) direct, 33,040 (+33,040) indirect)
 bytes in 2 (+2) blocks are definitely lost in loss record 138 of 138
 4270 ==31122==    at 0x4C2B292: posix_memalign (vg_replace_malloc.c:878)
 4271 ==31122==    by 0xD3BA31: av_malloc (mem.c:93)
 4272 ==31122==    by 0xD3BB91: av_mallocz (mem.c:207)
 4273 ==31122==    by 0xD2F16D: av_buffer_create (buffer.c:49)
 4274 ==31122==    by 0xD2F22B: av_buffer_alloc (buffer.c:76)
 4275 ==31122==    by 0xD2F98F: pool_alloc_buffer (buffer.c:318)
 4276 ==31122==    by 0xD2FB03: av_buffer_pool_get (buffer.c:356)
 4277 ==31122==    by 0xA1E050: audio_get_buffer (utils.c:491)
 4278 ==31122==    by 0xA1E71D: avcodec_default_get_buffer2 (utils.c:602)
 4279 ==31122==    by 0xA1F09D: get_buffer_internal (utils.c:815)
 4280 ==31122==    by 0xA1F100: ff_get_buffer (utils.c:827)
 4281 ==31122==    by 0xB69A12: frame_configure_elements (aacdec.c:218)
 4282 ==31122==    by 0xB72F72: aac_decode_frame_int (aacdec.c:2545)
 4283 ==31122==    by 0xB73590: aac_decode_frame (aacdec.c:2729)
 4284 ==31122==    by 0xA22F6A: avcodec_decode_audio4 (utils.c:2071)
 4285 ==31122==    by 0x417A93: decode_audio (ffmpeg.c:1500)
 4286 ==31122==    by 0x41940A: output_packet (ffmpeg.c:1833)
 4287 ==31122==    by 0x41EDEF: process_input (ffmpeg.c:3042)
 4288 ==31122==    by 0x41F16C: transcode_step (ffmpeg.c:3138)
 4289 ==31122==    by 0x41F2A5: transcode (ffmpeg.c:3195)
 4290 ==31122==    by 0x41F7E7: main (ffmpeg.c:3378)
 4291 ==31122== 0x63ADA80[24]
 4292 ==31122==   0x63AD8E0[40] indirect loss record 91
 4293 ==31122==     0x63AB780[8192] indirect loss record 137 [LEAKED, from
 ff_get_buffer just prior to the "Multiple frames in a packet from stream
 0"]
 4294 ==31122==     0x63ADC00[40] indirect loss record 113
 4295 ==31122==       0x63AB600[32] indirect loss record 69
 4296 ==31122==         0x63B2800[40] indirect loss record 113
 4297 ==31122==           0x63B0380[8192] indirect loss record 137 [LEAKED,
 from ff_get_buffer just after the "Multiple frames in a packet from stream
 0", leaks even though eventually frame unref'ed once by
 frame_configure_elements()]
 4298 ==31122==           0x63B4E00[40] indirect loss record 113
 4299 ==31122==             0x63B2980[8192] indirect loss record 137
 [LEAKED, ditto of 0x63B0380 frame]
 4300 ==31122== 0x63B0080[24]
 4301 ==31122==   0x63AFEE0[40] indirect loss record 91
 4302 ==31122==     0x63ADD80[8192] indirect loss record 137 [LEAKED, from
 ff_get_buffer just prior to the "Multiple frames in a packet from stream
 0"]
 4303 ==31122==     0x63B0200[40] indirect loss record 113

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


More information about the FFmpeg-trac mailing list