mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-01-31 01:20:46 +01:00
DroidFish: Secure FEN reader against division by zero.
This commit is contained in:
parent
9aa9279366
commit
97662f067e
|
@ -82,7 +82,7 @@ public class FENFile {
|
|||
continue;
|
||||
FenInfo fi = new FenInfo(fenNo++, line.trim());
|
||||
fensInFile.add(fi);
|
||||
final int newPercent = (int)(filePos * 100 / fileLen);
|
||||
final int newPercent = fileLen == 0 ? 0 : (int)(filePos * 100 / fileLen);
|
||||
if (newPercent > percent) {
|
||||
percent = newPercent;
|
||||
if (progress != null) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user