From f9d243e503091b49a2f5ebcbf1f2ce543a7e40d3 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 5 Jan 2018 22:03:42 -0330 Subject: [PATCH] Fixed incorrect size in memset; this time I'll sizeof. --- src/emucore/TIASurface.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index c16d525b4..d074bb2f3 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -54,7 +54,7 @@ TIASurface::TIASurface(OSystem& system) // Base TIA surface for use in taking snapshots in 1x mode myBaseTiaSurface = myFB.allocateSurface(kTIAW*2, kTIAH); - memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH); + memset(myRGBFramebuffer, 0, sizeof(myRGBFramebuffer)); // Enable/disable threading in the NTSC TV effects renderer myNTSCFilter.enableThreading(myOSystem.settings().getBool("threads")); @@ -229,7 +229,7 @@ void TIASurface::enablePhosphor(bool enable, int blend) myTiaSurface->setDirty(); mySLineSurface->setDirty(); - memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH * 4); + memset(myRGBFramebuffer, 0, sizeof(myRGBFramebuffer)); // Precalculate the average colors for the 'phosphor' effect if(myUsePhosphor) @@ -281,7 +281,7 @@ void TIASurface::enableNTSC(bool enable) myTiaSurface->setDirty(); mySLineSurface->setDirty(); - memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH * 4); + memset(myRGBFramebuffer, 0, sizeof(myRGBFramebuffer)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -