From: Steinar H. Gunderson Date: Sun, 17 Apr 2016 22:31:35 +0000 (+0200) Subject: Fix a memory leak in audio encoding. X-Git-Tag: 1.3.0~86 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=707c5ab81f03de6f0c16f515506543fa49e43a2c;p=nageru Fix a memory leak in audio encoding. --- diff --git a/h264encode.cpp b/h264encode.cpp index ae60763..63ed499 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -1750,12 +1750,12 @@ void H264EncoderImpl::encode_audio_one_frame( dest->add_packet(pkt, audio_pts + global_delay(), audio_pts + global_delay()); } } + + av_freep(&audio_frame->data[0]); + // TODO: Delayed frames. av_frame_unref(audio_frame); av_free_packet(&pkt); - - av_freep(&audio_frame->data[0]); - av_freep(&audio_frame->linesize[0]); } // this is weird. but it seems to put a new frame onto the queue