fix major memory corruption bug in the safeWriter
This commit is contained in:
parent
9841439917
commit
00b42767de
|
@ -7,7 +7,7 @@ unsigned char* SafeWriter::getFinalBuf() {
|
|||
}
|
||||
|
||||
void SafeWriter::checkSize(size_t amount) {
|
||||
if (curSeek+amount>=bufLen) {
|
||||
while ((curSeek+amount)>=bufLen) {
|
||||
unsigned char* newBuf=new unsigned char[bufLen+WRITER_BUF_SIZE];
|
||||
memcpy(newBuf,buf,bufLen);
|
||||
delete[] buf;
|
||||
|
|
Loading…
Reference in New Issue