This commit is contained in:
Guilhem Lavaux 2020-11-11 10:46:27 +01:00
parent 71691956cc
commit 9b148414b6
2 changed files with 8 additions and 2 deletions

View file

@ -143,10 +143,16 @@ void UnformattedRead::endCheckpoint(bool autodrop)
delete[] recordBuffer;
recordBuffer = 0;
}
if (cSize == Check_32bits) {
if (checkPointAccum >= 1<<32UL) {
always_fail = true;
checkPointAccum %= (1<<32UL);
}
}
if (checkPointRef != checkPointAccum)
{
if (!autodrop || checkPointAccum > checkPointRef) {
if (always_fail || !autodrop || checkPointAccum > checkPointRef) {
throw InvalidUnformattedAccess();
}
f->seekg(checkPointRef-checkPointAccum, ios::cur);