Changeset - r27873:cd9211bedaf0
[Not reviewed]
master
0 2 0
Patric Stout - 8 months ago 2023-09-09 14:06:00
truebrain@openttd.org
Fix: crash when opening a damaged base-graphics (#11275)
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/random_access_file.cpp
Show inline comments
 
@@ -146,9 +146,10 @@ void RandomAccessFile::ReadBlock(void *p
 
 * Skip \a n bytes ahead in the file.
 
 * @param n Number of bytes to skip reading.
 
 */
 
void RandomAccessFile::SkipBytes(int n)
 
void RandomAccessFile::SkipBytes(size_t n)
 
{
 
	int remaining = this->buffer_end - this->buffer;
 
	assert(this->buffer_end >= this->buffer);
 
	size_t remaining = this->buffer_end - this->buffer;
 
	if (n <= remaining) {
 
		this->buffer += n;
 
	} else {
src/random_access_file_type.h
Show inline comments
 
@@ -51,7 +51,7 @@ public:
 
	uint32_t ReadDword();
 

	
 
	void ReadBlock(void *ptr, size_t size);
 
	void SkipBytes(int n);
 
	void SkipBytes(size_t n);
 
};
 

	
 
#endif /* RANDOM_ACCESS_FILE_TYPE_H */
0 comments (0 inline, 0 general)