Throw an exception if seeking to invalid positions is requested in the memory IO class.

This commit is contained in:
Moritz Bunkus 2009-04-30 19:34:47 +02:00
parent 11ba305d6e
commit c0f2ee61ee

View File

@ -980,12 +980,10 @@ mm_mem_io_c::setFilePointer(int64 offset,
else
npos = pos + offset;
if (npos < 0)
pos = 0;
else if (npos >= mem_size)
pos = mem_size;
else
if ((0 <= npos) && (mem_size >= npos))
pos = npos;
else
throw mm_io_seek_error_c();
}
uint32