mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-12 02:44:00 +00:00
Fix leaks in sceMpeg demuxing.
This commit is contained in:
parent
917af7b571
commit
ea9a6c1b58
@ -470,6 +470,11 @@ u32 sceMpegCreate(u32 mpegAddr, u32 dataPtr, u32 size, u32 ringbufferAddr, u32 f
|
||||
Memory::Write_U32(ringbuffer->dataUpperBound, mpegHandle + 20);
|
||||
}
|
||||
MpegContext *ctx = new MpegContext;
|
||||
if (mpegMap.find(mpegHandle) != mpegMap.end()) {
|
||||
WARN_LOG_REPORT(HLE, "Replacing existing mpeg context at %08x", mpegAddr);
|
||||
// Otherwise, it would leak.
|
||||
delete mpegMap[mpegHandle];
|
||||
}
|
||||
mpegMap[mpegHandle] = ctx;
|
||||
|
||||
// Initialize mpeg values.
|
||||
|
@ -27,7 +27,8 @@ MpegDemux::MpegDemux(int size, int offset) : m_audioStream(size) {
|
||||
m_readSize = 0;
|
||||
}
|
||||
|
||||
MpegDemux::~MpegDemux(void) {
|
||||
MpegDemux::~MpegDemux() {
|
||||
delete [] m_buf;
|
||||
}
|
||||
|
||||
void MpegDemux::DoState(PointerWrap &p) {
|
||||
|
@ -12,7 +12,7 @@ class MpegDemux
|
||||
{
|
||||
public:
|
||||
MpegDemux(int size, int offset);
|
||||
~MpegDemux(void);
|
||||
~MpegDemux();
|
||||
|
||||
bool addStreamData(u8* buf, int addSize);
|
||||
void demux(int audioChannel);
|
||||
|
Loading…
Reference in New Issue
Block a user