From: Holger Schemel Date: Wed, 10 Jan 2018 09:29:19 +0000 (+0100) Subject: fixed loading tapes that exceed the maximum allowed tape size X-Git-Tag: 4.0.1.1~18 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0ab6e77cdee7930da7fc143d29c5f8658ec046cc;p=rocksndiamonds.git fixed loading tapes that exceed the maximum allowed tape size --- diff --git a/src/files.c b/src/files.c index 83749a57..1f07c489 100644 --- 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++) {