Fix crash in Qt CDL when cdloggerVideoDataSize is zero.
This commit is contained in:
parent
6b73e91c38
commit
56c0d30f83
|
@ -790,7 +790,14 @@ void InitCDLog(void)
|
||||||
if (!CHRram[0] || (CHRptr[0] == PRGptr[0]))
|
if (!CHRram[0] || (CHRptr[0] == PRGptr[0]))
|
||||||
{ // Some kind of workaround for my OneBus VRAM hack, will remove it if I find another solution for that
|
{ // Some kind of workaround for my OneBus VRAM hack, will remove it if I find another solution for that
|
||||||
cdloggerVideoDataSize = CHRsize[0];
|
cdloggerVideoDataSize = CHRsize[0];
|
||||||
cdloggervdata = (unsigned char *)malloc(cdloggerVideoDataSize);
|
if (cdloggerVideoDataSize > 0)
|
||||||
|
{
|
||||||
|
cdloggervdata = (unsigned char *)malloc(cdloggerVideoDataSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cdloggervdata = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -832,7 +839,10 @@ void ResetCDLog(void)
|
||||||
if (GameInfo->type != GIT_NSF)
|
if (GameInfo->type != GIT_NSF)
|
||||||
{
|
{
|
||||||
undefinedvromcount = 8192;
|
undefinedvromcount = 8192;
|
||||||
memset(cdloggervdata, 0, 8192);
|
if (cdloggervdata != NULL)
|
||||||
|
{
|
||||||
|
memset(cdloggervdata, 0, 8192);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
|
Loading…
Reference in New Issue