Make MemoryIOStream::Seek accept pos=length as valid

Fixes assimp/assimp#1781.
pull/1789/head
mbuchner 2018-02-12 10:52:49 +01:00
parent 78ec30b320
commit 76b981aa2a
1 changed files with 3 additions and 3 deletions

View File

@ -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;