From 5ccc4bbfdf2e457831a13ddb591354ab86aa4e73 Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Wed, 5 Sep 2012 22:35:49 +0000 Subject: [PATCH] SuperVU: fixed null pointer dereference in constructing an exception object. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5406 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/sVU_zerorec.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcsx2/x86/sVU_zerorec.cpp b/pcsx2/x86/sVU_zerorec.cpp index b06193b8e8..abe61f1988 100644 --- a/pcsx2/x86/sVU_zerorec.cpp +++ b/pcsx2/x86/sVU_zerorec.cpp @@ -350,7 +350,8 @@ static void SuperVUAlloc(int vuindex) { if (s_recVUMem[vuindex]) return; - s_recVUMem[vuindex] = new RecompiledCodeReserve( pxsFmt("SuperVU%u Recompiler Cache", vuindex), 0 ); + wxString mem_name = pxsFmt("SuperVU%u Recompiler Cache", vuindex); + s_recVUMem[vuindex] = new RecompiledCodeReserve( mem_name, 0 ); s_recVUMem[vuindex]->Reserve( sVU_EXESIZE, vuindex ? HostMemoryMap::sVU1rec : HostMemoryMap::sVU0rec, _256mb ); s_recVUMem[vuindex]->SetProfilerName(pxsFmt("sVU%urec",vuindex)); @@ -358,7 +359,7 @@ static void SuperVUAlloc(int vuindex) if (!s_recVUMem[vuindex]->IsOk()) { safe_delete(s_recVUMem[vuindex]); - throw Exception::VirtualMemoryMapConflict( s_recVUMem[vuindex]->GetName() ) + throw Exception::VirtualMemoryMapConflict(mem_name) .SetDiagMsg(pxsFmt( L"SuperVU failed to allocate virtual memory below 256MB." )) .SetUserMsg(pxE( L"Out of Memory (sorta): The SuperVU recompiler was unable to reserve the specific memory ranges required, and will not be available for use. This is not a critical error, since the sVU rec is obsolete, and you should use microVU instead anyway. :)" ));