From 3a36bfbcbbe7a59eb948f0edc6fce88b70d75fc7 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sun, 8 Nov 2015 19:50:42 +1300 Subject: [PATCH] FifoAnalyzer: Double check command size while recording. Since we now return the value, might as well check it's correct. --- Source/Core/Core/FifoPlayer/FifoRecorder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/FifoPlayer/FifoRecorder.cpp b/Source/Core/Core/FifoPlayer/FifoRecorder.cpp index 7a1d6bd7f3..7801722b02 100644 --- a/Source/Core/Core/FifoPlayer/FifoRecorder.cpp +++ b/Source/Core/Core/FifoPlayer/FifoRecorder.cpp @@ -70,7 +70,11 @@ void FifoRecorder::WriteGPCommand(u8* data, u32 size) { // Assumes data contains all information for the command // Calls FifoRecorder::UseMemory - FifoAnalyzer::AnalyzeCommand(data, FifoAnalyzer::DECODE_RECORD); + u32 analyzed_size = FifoAnalyzer::AnalyzeCommand(data, FifoAnalyzer::DECODE_RECORD); + + // Make sure FifoPlayer's command analyzer agrees about the size of the command. + if (analyzed_size != size) + PanicAlert("FifoRecorder: Expected command to be %i bytes long, we were given %i bytes", analyzed_size, size); // Copy data to buffer size_t currentSize = m_FifoData.size();