X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2Ffile.c;h=9fa3908a8dc8df1e50b6636a5a26e9b8a52ac467;hb=310781167f731177d6d46b15093dc32606eeac4e;hp=bd1a0fa0833ac43be47f3bf8ee0bd262719d7d06;hpb=68907af560a253c727564b478d38eb0408ce0389;p=rocksndiamonds.git 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); }