From e18275c1c0f405b9fbbdc9f42cc8065b160c4dba Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 8 Nov 2023 11:14:56 +0100 Subject: [PATCH] fix: Division by zero when setting page size to 0 --- lib/libimhex/source/providers/provider.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libimhex/source/providers/provider.cpp b/lib/libimhex/source/providers/provider.cpp index 1f46366f8..f17591c42 100644 --- a/lib/libimhex/source/providers/provider.cpp +++ b/lib/libimhex/source/providers/provider.cpp @@ -185,6 +185,8 @@ namespace hex::prv { void Provider::setPageSize(size_t pageSize) { if (pageSize > MaxPageSize) pageSize = MaxPageSize; + if (pageSize == 0) + return; this->m_pageSize = pageSize; }