From 76b981aa2a7542e71220f737f2a8c8a22ab0d740 Mon Sep 17 00:00:00 2001 From: mbuchner Date: Mon, 12 Feb 2018 10:52:49 +0100 Subject: [PATCH] Make MemoryIOStream::Seek accept pos=length as valid Fixes assimp/assimp#1781. --- include/assimp/MemoryIOWrapper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 0e9b23447..bfcfff9c2 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -99,19 +99,19 @@ public: // Seek specific position aiReturn Seek(size_t pOffset, aiOrigin pOrigin) { if (aiOrigin_SET == pOrigin) { - if (pOffset >= length) { + if (pOffset > length) { return AI_FAILURE; } pos = pOffset; } else if (aiOrigin_END == pOrigin) { - if (pOffset >= length) { + if (pOffset > length) { return AI_FAILURE; } pos = length-pOffset; } else { - if (pOffset+pos >= length) { + if (pOffset+pos > length) { return AI_FAILURE; } pos += pOffset;