Unverified Commit 9e4dfba3 authored by kaamui's avatar kaamui Committed by GitHub

Merge pull request #223 from bartoszek/patch-2

Fix massive memory leak in UBFFmpegVideoEncoderWorker.
parents e8a18a78 4915326a
......@@ -744,6 +744,7 @@ void UBFFmpegVideoEncoderWorker::writeLatestVideoFrame()
{
AVFrame* frame = mImageQueue.dequeue();
writeFrame(frame, mVideoPacket, mController->mVideoStream, mController->mOutputFormatContext);
av_freep(&frame->data[0]);
av_frame_free(&frame);
}
......@@ -756,6 +757,7 @@ void UBFFmpegVideoEncoderWorker::writeLatestAudioFrame()
#if LIBAVFORMAT_VERSION_MICRO < 100
if (audio_samples_buffer) {
av_free(audio_samples_buffer);
av_freep(&frame->data[0]);
audio_samples_buffer = NULL;
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment