From b322ef286e09df31b3e72452bbe0d2af345ec5a1 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 19 Jul 2016 19:51:31 +0200 Subject: [PATCH] CDVD: initialize a temporary buffer I'm not sure to understand why Valgrind reports it as we populate the buffer during the ReadAsync. Maybe Valgrind doesn't like async IO from the kernel. In doubt, the init will avoid those warnings ==19897== Thread 6 EE Core: ==19897== Conditional jump or move depends on uninitialised value(s) ==19897== at 0x80FE9E1: BlockdumpFileReader::DetectBlockdump(AsyncFileReader*) (BlockdumpFileReader.cpp:40) ==19897== by 0x8109EE5: InputIsoFile::Open(wxString const&, bool) (InputIsoFile.cpp:229) ==19897== by 0x810939E: ISOopen(char const*) (CDVDisoReader.cpp:57) ==19897== by 0x810194E: DoCDVDopen() (CDVDaccess.cpp:359) ==19897== by 0x80B651C: SysCorePlugins::OpenPlugin_CDVD() (PluginManager.cpp:1219) --- pcsx2/CDVD/BlockdumpFileReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/CDVD/BlockdumpFileReader.cpp b/pcsx2/CDVD/BlockdumpFileReader.cpp index b4f9f736a1..8d1b073763 100644 --- a/pcsx2/CDVD/BlockdumpFileReader.cpp +++ b/pcsx2/CDVD/BlockdumpFileReader.cpp @@ -34,7 +34,7 @@ bool BlockdumpFileReader::DetectBlockdump(AsyncFileReader* reader) reader->SetBlockSize(1); - char buf[4]; + char buf[5] = {0}; reader->ReadSync(buf, 0, 4); bool isbd = (strncmp(buf, "BDV2", 4) == 0);