X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=6839934a166cb2252154a2ad45024865a69e1f86;hb=4b754efd3659a70c50fc0b575ed55af5f181b290;hp=49fe48569f6ddad83e5d5d78144075a60f07093d;hpb=530042f134f8d59f80a7c71168d65edc0da1be10;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 49fe4856..6839934a 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 @@ -3598,6 +3606,8 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, { Warn("wrong size (%d) of chunk '%s' in level file '%s'", chunk_size, chunk_name, filename); + + break; } } }