X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ffiles.c;fp=src%2Ffiles.c;h=e86364db9f077fd4b678703a0394069b25e58c24;hp=49fe48569f6ddad83e5d5d78144075a60f07093d;hb=84a0a448bb1715b6dea187e3aedc902e5bbc2439;hpb=530042f134f8d59f80a7c71168d65edc0da1be10 diff --git a/src/files.c b/src/files.c index 49fe4856..e86364db 100644 --- a/src/files.c +++ b/src/files.c @@ -3591,6 +3591,14 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, int chunk_size_expected = (chunk_info[i].loader)(file, chunk_size, level); + if (chunk_size_expected < 0) + { + Warn("error reading chunk '%s' in level file '%s'", + chunk_name, filename); + + break; + } + // the size of some chunks cannot be checked before reading other // chunks first (like "HEAD" and "BODY") that contain some header // information, so check them here