From 1a61bcd286f07cd44e94ad8b8f97732c397d01a3 Mon Sep 17 00:00:00 2001 From: lrw04 <2428592483@qq.com> Date: Mon, 28 Aug 2023 17:51:15 +0800 Subject: [PATCH] Fix potential overflow in determining the datatype (#4988) --- src/modelbin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modelbin.cpp b/src/modelbin.cpp index 75a82af4..85e27026 100644 --- a/src/modelbin.cpp +++ b/src/modelbin.cpp @@ -117,7 +117,7 @@ Mat ModelBinFromDataReader::load(int w, int type) const return Mat(); } - unsigned int flag = flag_struct.f0 + flag_struct.f1 + flag_struct.f2 + flag_struct.f3; + unsigned int flag = (int)flag_struct.f0 + flag_struct.f1 + flag_struct.f2 + flag_struct.f3; if (flag_struct.tag == 0x01306B47) { -- GitLab