libebml: fix the size returned by MemIOCallback::read() when reaching the end of the buffer

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@747 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Steve Lhomme 2011-04-26 17:14:24 +00:00
parent 81b5b9ff60
commit f2545cc6d7

View File

@ -72,8 +72,9 @@ uint32 MemIOCallback::read(void *Buffer, size_t Size)
{
//We will only return the remaining data
memcpy(Buffer, dataBuffer + dataBufferPos, dataBufferTotalSize - dataBufferPos);
uint64 oldDataPos = dataBufferPos;
dataBufferPos = dataBufferTotalSize;
return dataBufferTotalSize - dataBufferPos;
return dataBufferTotalSize - oldDataPos;
}
//Well... We made it here, so do a quick and simple copy