Opened 2 years ago

Closed 2 years ago

Last modified 2 years 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


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) {


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_picture_rgb_ptr->data, m_picture_rgb_ptr->linesize);




Attachments (1)

memory_leak_callstack.png (485.7 KB) - added by msafroshkin 2 years ago.
memory leak callstack

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by msafroshkin

memory leak callstack

comment:1 Changed 2 years ago by msafroshkin

  • Component changed from avutil to avcodec

comment:2 Changed 2 years ago by msafroshkin

memory releases when I do :

comment:3 Changed 2 years ago by msafroshkin

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

comment:4 Changed 2 years ago by cehoyos

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