From dfad2ba84501f4cf4e005e4c2517fb4ca3462518 Mon Sep 17 00:00:00 2001 From: shenweip Date: Tue, 26 Nov 2013 23:45:45 +0800 Subject: [PATCH] Avoid a dangerous zero. --- Core/Dialog/PSPGamedataInstallDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/Dialog/PSPGamedataInstallDialog.cpp b/Core/Dialog/PSPGamedataInstallDialog.cpp index 63e6ce065e..0b8e4c9e06 100644 --- a/Core/Dialog/PSPGamedataInstallDialog.cpp +++ b/Core/Dialog/PSPGamedataInstallDialog.cpp @@ -147,7 +147,10 @@ void PSPGamedataInstallDialog::updateProgress() { // Update progress bar(if there is). // progress value is progress[3] << 24 | progress[2] << 16 | progress[1] << 8 | progress[0]. // We only should update progress[0] here as the max progress value is 100. - progressValue = (int)(allReadSize / allFilesSize) * 100; + if (allFilesSize != 0) + progressValue = (int)(allReadSize / allFilesSize) * 100; + else + progressValue = 100; request.progress[0] = progressValue; Memory::WriteStruct(paramAddr,&request); }