diff --git a/apps/openmw/mwrender/videoplayer.cpp b/apps/openmw/mwrender/videoplayer.cpp index 74b52c06b..adf20dc63 100644 --- a/apps/openmw/mwrender/videoplayer.cpp +++ b/apps/openmw/mwrender/videoplayer.cpp @@ -949,7 +949,9 @@ void VideoState::init(const std::string& resourceName) this->format_ctx->pb = ioCtx; // Open video file - /// \todo leak here, ffmpeg or valgrind bug ? + /// + /// format_ctx->pb->buffer must be freed by hand, + /// if not, valgrind will show memleak, see: /// /// https://trac.ffmpeg.org/ticket/1357 /// @@ -1023,11 +1025,12 @@ void VideoState::deinit() if(this->format_ctx) { - // valgrind shows memleak near format_ctx->pb - // - // As scrawl pointed, memleak could be related to this ffmpeg ticket: - // https://trac.ffmpeg.org/ticket/1357 - // + /// + /// format_ctx->pb->buffer must be freed by hand, + /// if not, valgrind will show memleak, see: + /// + /// https://trac.ffmpeg.org/ticket/1357 + /// if (this->format_ctx->pb != NULL) { av_free(this->format_ctx->pb->buffer); diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 13d11f691..c83697442 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -231,9 +231,9 @@ void FFmpeg_Decoder::close() { if (mFormatCtx->pb != NULL) { - // valgrind shows memleak near mFormatCtx->pb + // mFormatCtx->pb->buffer must be freed by hand, + // if not, valgrind will show memleak, see: // - // As scrawl pointed, memleak could be related to this ffmpeg ticket: // https://trac.ffmpeg.org/ticket/1357 // if (mFormatCtx->pb->buffer != NULL)