Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#7224 closed defect (invalid)

memory leak av_codec_send_packet

Reported by: msafroshkin Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
when do avcodec_send_packet, av_util 5.6 allocates memory and never cleans it

How to reproduce:
{connect ip camera or open long video in h264
{
while (1)

{
av_read_frame(m_format_ctx_ptr, m_packet);
const int res = avcodec_send_packet(m_codec_ctx_ptr, m_packet);
if (res != 0) {

return;}

while (avcodec_receive_frame(m_codec_ctx_ptr, m_picture_ptr) == 0)

{

const int err_height = sws_scale(m_img_convert_ctx_ptr,

m_picture_ptr->data, m_picture_ptr->linesize, 0,

m_codec_ctx_ptr->height,

m_picture_rgb_ptr->data, m_picture_rgb_ptr->linesize);


av_frame_unref(m_picture_ptr);
}

}

}}

Attachments (1)

memory_leak_callstack.png (485.7 KB) - added by msafroshkin 3 months ago.
memory leak callstack

Download all attachments as: .zip

Change History (5)

Changed 3 months ago by msafroshkin

memory leak callstack

comment:1 Changed 3 months ago by msafroshkin

  • Component changed from avutil to avcodec

comment:2 Changed 3 months ago by msafroshkin

memory releases when I do :
avcodec_flush_buffers(m_codec_ctx_ptr);
avcodec_free_context(&m_codec_ctx_ptr);

comment:3 Changed 3 months ago by msafroshkin

  • Resolution set to invalid
  • Status changed from new to closed

comment:4 Changed 3 months ago by cehoyos

  • Component changed from avcodec to undetermined
  • Keywords memory leak removed
Note: See TracTickets for help on using tickets.