From: Holger Schemel Date: Mon, 8 Jan 2018 15:28:57 +0000 (+0100) Subject: added warning when loading Supaplex demo that exceeds maximum demo size X-Git-Tag: 4.0.1.1~22 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=035ca48bd333abcf01acf29584817bc80e03e498;p=rocksndiamonds.git added warning when loading Supaplex demo that exceeds maximum demo size --- diff --git a/src/game_sp/file.c b/src/game_sp/file.c index bd1a0fa0..9fa3908a 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -257,6 +257,10 @@ static void LoadNativeLevelFromFileStream_SP(File *file, int width, int height, break; } + if (i >= SP_MAX_TAPE_LEN) + Error(ERR_WARN, "SP demo truncated: size exceeds maximum SP demo size %d", + SP_MAX_TAPE_LEN); + native_sp_level.demo.length = i; native_sp_level.demo.is_available = (native_sp_level.demo.length > 0); }