From 62af456840102cf808fd64cc59e73ce8d489e82c Mon Sep 17 00:00:00 2001 From: cam900 Date: Fri, 12 Jul 2024 18:00:36 +0900 Subject: [PATCH] Fix segmentation fault --- src/engine/platform/opl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index d836379c0..4e618f411 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -3122,10 +3122,10 @@ const DivMemoryComposition* DivPlatformOPL::getMemCompo(int index) { void DivPlatformOPL::renderSamples(int sysID) { if (adpcmChan<0 && pcmChanOffs<0) return; - if (adpcmBMem!=NULL) { + if (adpcmChan>=0 && adpcmBMem!=NULL) { memset(adpcmBMem,0,262144); } - if (pcmMem!=NULL) { + if (pcmChanOffs>=0 && pcmMem!=NULL) { memset(pcmMem,0,4194304); } memset(sampleOffPCM,0,256*sizeof(unsigned int));