projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73cee55
)
fixed loading tapes that exceed the maximum allowed tape size
author
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 09:29:19 +0000
(10:29 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 09:29:19 +0000
(10:29 +0100)
src/files.c
patch
|
blob
|
history
diff --git
a/src/files.c
b/src/files.c
index 83749a573d4f62489989211475bd53dfdf9103b0..1f07c4894bd51a5e387e5aa62eb1042b902d8814 100644
(file)
--- a/
src/files.c
+++ b/
src/files.c
@@
-7388,7
+7388,16
@@
static int LoadTape_BODY(File *file, int chunk_size, struct TapeInfo *tape)
for (i = 0; i < tape->length; i++)
{
if (i >= MAX_TAPE_LEN)
+ {
+ Error(ERR_WARN, "tape truncated -- size exceeds maximum tape size %d",
+ MAX_TAPE_LEN);
+
+ // tape too large; read and ignore remaining tape data from this chunk
+ for (;i < tape->length; i++)
+ ReadUnusedBytesFromFile(file, tape->num_participating_players + 1);
+
break;
+ }
for (j = 0; j < MAX_PLAYERS; j++)
{