Merge pull request #223 from bartoszek/patch-2

Fix massive memory leak in UBFFmpegVideoEncoderWorker.
preferencesAboutTextFull
kaamui 6 years ago committed by GitHub
commit 9e4dfba31b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/podcast/ffmpeg/UBFFmpegVideoEncoder.cpp

@ -744,6 +744,7 @@ void UBFFmpegVideoEncoderWorker::writeLatestVideoFrame()
{ {
AVFrame* frame = mImageQueue.dequeue(); AVFrame* frame = mImageQueue.dequeue();
writeFrame(frame, mVideoPacket, mController->mVideoStream, mController->mOutputFormatContext); writeFrame(frame, mVideoPacket, mController->mVideoStream, mController->mOutputFormatContext);
av_freep(&frame->data[0]);
av_frame_free(&frame); av_frame_free(&frame);
} }
@ -756,6 +757,7 @@ void UBFFmpegVideoEncoderWorker::writeLatestAudioFrame()
#if LIBAVFORMAT_VERSION_MICRO < 100 #if LIBAVFORMAT_VERSION_MICRO < 100
if (audio_samples_buffer) { if (audio_samples_buffer) {
av_free(audio_samples_buffer); av_free(audio_samples_buffer);
av_freep(&frame->data[0]);
audio_samples_buffer = NULL; audio_samples_buffer = NULL;
} }
#endif #endif

Loading…
Cancel
Save