Merge pull request #1789 from mabuchner/issue_1781

Make MemoryIOStream::Seek accept pos=length as valid
pull/1795/head^2
Kim Kulling 2018-02-13 14:44:19 +01:00 committed by GitHub
commit ae88cab2ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;