diff --git a/src/unpackertool/plugins/mpress/mpress.cpp b/src/unpackertool/plugins/mpress/mpress.cpp index 0551540c6..2734a6f3e 100644 --- a/src/unpackertool/plugins/mpress/mpress.cpp +++ b/src/unpackertool/plugins/mpress/mpress.cpp @@ -234,7 +234,7 @@ std::uint32_t MpressPlugin::getFixStub() void MpressPlugin::fixJumpsAndCalls(DynamicBuffer& buffer) { std::uint32_t pos = 0; - std::uint32_t maxAddr = buffer.getRealDataSize() - 0x1000; + std::uint32_t maxAddr = std::max(0, static_cast(buffer.getRealDataSize()) - 0x1000); while (pos < maxAddr) { std::uint32_t moveOffset = pos;