From 2240cae3bfe4f7a91fbf911eb4addfaf8b72942c Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 24 Mar 2014 11:41:18 +0100 Subject: [PATCH] Prevent overrunning the debug print overlay buffer --- Core/HLE/sceDisplay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 5ebfc459cf..b7698b8d52 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -368,7 +368,7 @@ void __DisplayGetDebugStats(char stats[2048]) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; - sprintf(stats, + snprintf(stats, 2047, "Frames: %i\n" "DL processing time: %0.2f ms\n" "Kernel processing time: %0.2f ms\n" @@ -417,7 +417,7 @@ void __DisplayGetDebugStats(char stats[2048]) { gpuStats.numFragmentShaders, gpuStats.numShaders ); - + stats[2047] = '\0'; gpuStats.ResetFrame(); kernelStats.ResetFrame(); }