Added NULL pointer check to avoid crashes when initializing zapper with no ROM loaded.
This commit is contained in:
parent
c2c76de841
commit
5c4f402a1f
|
@ -1171,7 +1171,7 @@ void GetMouseData (uint32 (&d)[3])
|
|||
b |= 0x02;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( consoleWindow->viewport_GL )
|
||||
{
|
||||
consoleWindow->viewport_GL->getNormalizedCursorPos(nx,ny);
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ static INPUTC ZAPVSC={ReadZapperVS,0,StrobeZapperVS,UpdateZapper,ZapperFrapper,D
|
|||
INPUTC *FCEU_InitZapper(int w)
|
||||
{
|
||||
memset(&ZD[w],0,sizeof(ZAPPER));
|
||||
if(GameInfo->type == GIT_VSUNI)
|
||||
if ( (GameInfo != NULL) && (GameInfo->type == GIT_VSUNI) )
|
||||
return(&ZAPVSC);
|
||||
else
|
||||
return(&ZAPC);
|
||||
|
|
Loading…
Reference in New Issue