From 3fcecfa5ec2d898b5b2393a2aa0e2b2a62f4679b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 15 Mar 2023 22:02:56 -0700 Subject: [PATCH] Atrac: Ensure codecCtx doesn't leak. Although, I don't think we're reallocating it. --- Core/HLE/sceAtrac.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index dac70d4b27..bf16281139 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1853,6 +1853,11 @@ int __AtracSetContext(Atrac *atrac) { return hleReportError(ME, ATRAC_ERROR_UNKNOWN_FORMAT, "unknown codec type in set context"); } + if (atrac->codecCtx_) { + // Shouldn't happen, but just in case. + atrac->ReleaseFFMPEGContext(); + } + const AVCodec *codec = avcodec_find_decoder(ff_codec); atrac->codecCtx_ = avcodec_alloc_context3(codec);