From 886467e09f815fda97bbea9090b045bb6fb803f3 Mon Sep 17 00:00:00 2001 From: Tomasz Sobczyk Date: Thu, 22 Oct 2020 11:16:41 +0200 Subject: [PATCH] Fix crash when trying to read a non existing .binpack file. --- src/extra/nnue_data_binpack_format.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/extra/nnue_data_binpack_format.h b/src/extra/nnue_data_binpack_format.h index 826b2959..b9e45c3e 100644 --- a/src/extra/nnue_data_binpack_format.h +++ b/src/extra/nnue_data_binpack_format.h @@ -6141,6 +6141,11 @@ namespace binpack [[nodiscard]] bool hasNextChunk() { + if (!m_file) + { + return false; + } + m_file.peek(); return !m_file.eof(); }