Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7224 closed defect (invalid)

memory leak av_codec_send_packet

Reported by: hagorms 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 hagorms 6 years ago.
memory leak callstack

Download all attachments as: .zip

Change History (5)

by hagorms, 6 years ago

Attachment: memory_leak_callstack.png added

memory leak callstack

comment:1 by hagorms, 6 years ago

Component: avutilavcodec

comment:2 by hagorms, 6 years ago

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

comment:3 by hagorms, 6 years ago

Resolution: invalid
Status: newclosed

comment:4 by Carl Eugen Hoyos, 6 years ago

Component: avcodecundetermined
Keywords: memory leak removed
Note: See TracTickets for help on using tickets.