mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
audio_decoder: fix more memleaks and dangling files
This commit is contained in:
parent
b67837c0ef
commit
4ad4badcfe
2 changed files with 20 additions and 10 deletions
|
|
@ -278,7 +278,7 @@ public:
|
|||
#endif
|
||||
AVCodecContext* ctx = nullptr;
|
||||
AVFormatContext* fmt = nullptr;
|
||||
u8* io_buf;
|
||||
u8* io_buf = nullptr;
|
||||
|
||||
struct AudioReader
|
||||
{
|
||||
|
|
@ -372,15 +372,16 @@ public:
|
|||
if (ctx)
|
||||
{
|
||||
avcodec_close(ctx);
|
||||
avformat_close_input(&fmt);
|
||||
avcodec_free_context(&ctx);
|
||||
}
|
||||
if (io_buf)
|
||||
{
|
||||
av_freep(&io_buf);
|
||||
}
|
||||
if (fmt)
|
||||
{
|
||||
if (io_buf)
|
||||
{
|
||||
av_free(io_buf);
|
||||
}
|
||||
if (fmt->pb) av_free(fmt->pb);
|
||||
if (fmt->pb) av_freep(&fmt->pb);
|
||||
avformat_close_input(&fmt);
|
||||
avformat_free_context(fmt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue