MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / verifyRecordingFileHeader

Method verifyRecordingFileHeader

pcsx2/Recording/InputRecordingFile.cpp:256–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256bool InputRecordingFile::verifyRecordingFileHeader()
257{
258 if (m_recordingFile == nullptr)
259 {
260 return false;
261 }
262 // Verify header contents
263 rewind(m_recordingFile);
264 if (fread(&m_header, sizeof(InputRecordingFileHeader), 1, m_recordingFile) != 1 ||
265 fread(&m_totalFrames, 4, 1, m_recordingFile) != 1 ||
266 fread(&m_undoCount, 4, 1, m_recordingFile) != 1 ||
267 fread(&m_savestate, sizeof(bool), 1, m_recordingFile) != 1)
268 {
269 return false;
270 }
271
272 // Check for current verison
273 if (m_header.m_fileVersion != 1)
274 {
275 InputRec::consoleLog(fmt::format("Input recording file is not a supported version - {}", m_header.m_fileVersion));
276 return false;
277 }
278 return true;
279}

Callers

nothing calls this directly

Calls 2

consoleLogFunction · 0.85
formatFunction · 0.50

Tested by

no test coverage detected