summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2011-11-25 11:45:46 +0000
committerpeter1138 <peter1138@openttd.org>2011-11-25 11:45:46 +0000
commit8be8d5e843c0b1cdc3f94cdd1a3febc5a2ff197e (patch)
tree7d25e80a6b017cd015258487d760258a8cc8720d
parent7ff6daee8066276207f7e9fd6f10e9da3b4b1019 (diff)
downloadopenttd-8be8d5e843c0b1cdc3f94cdd1a3febc5a2ff197e.tar.xz
(svn r23324) -Fix (r15555): Don't free reusable buffer.
-rw-r--r--src/spriteloader/grf.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/spriteloader/grf.cpp b/src/spriteloader/grf.cpp
index 2876f2f35..b4533ae94 100644
--- a/src/spriteloader/grf.cpp
+++ b/src/spriteloader/grf.cpp
@@ -109,7 +109,6 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
do {
if (dest + 2 > dest_orig + dest_size) {
- free(sprite->data);
return WarnCorruptSprite(file_slot, file_pos, __LINE__);
}
@@ -125,7 +124,6 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
data = &sprite->data[y * sprite->width + skip];
if (skip + length > sprite->width || dest + length > dest_orig + dest_size) {
- free(sprite->data);
return WarnCorruptSprite(file_slot, file_pos, __LINE__);
}
@@ -142,7 +140,6 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
}
} else {
if (dest_size < sprite->width * sprite->height) {
- free(sprite->data);
return WarnCorruptSprite(file_slot, file_pos, __LINE__);
}