Fix filestream read

This commit is contained in:
Henrique Santiago 2014-05-09 18:56:15 -03:00
parent b1964a1c10
commit 72b3403728
1 changed files with 1 additions and 2 deletions

View File

@ -114,11 +114,10 @@ int FileStream::read(void *buffer, uint32 size, uint32 nmemb)
throwError("read failed", true);
return res;
} else {
uint maxReadPos = m_data.size()-1;
int writePos = 0;
uint8 *outBuffer = (uint8*)buffer;
for(uint i=0;i<nmemb;++i) {
if(m_pos+size > maxReadPos)
if(m_pos+size > m_data.size())
return i;
for(uint j=0;j<size;++j)