From 609e7369bd76e5108ecc84ed63cfde0315017d09 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 21 May 2020 20:54:45 +0200 Subject: [PATCH] Add safe-guard in getNumFromBits() --- lib/Unishox-1.0-shadinger/src/unishox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Unishox-1.0-shadinger/src/unishox.cpp b/lib/Unishox-1.0-shadinger/src/unishox.cpp index 9c235582a..743eed38c 100644 --- a/lib/Unishox-1.0-shadinger/src/unishox.cpp +++ b/lib/Unishox-1.0-shadinger/src/unishox.cpp @@ -420,6 +420,7 @@ int32_t Unishox::getNumFromBits(uint32_t count) { while (count--) { ret += getNextBit() << count; } + if (in_eof) return 0; return ret; }