1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

(svn r24607) [1.2] -Backport from trunk:

- Fix: Configure script did not properly handle _BUILD flags during reconfigure (r24601)
- Fix: Configure script failed to detect libfontconfig 2.10 as newer than 2.3 (r24598)
- Fix: When fontconfig is not available, the bootstrap download crashed [FS#5336] (r24597)
- Fix: Crash when a gamescript provided too many parameters to a GSText object [FS#5333] (r24593)
This commit is contained in:
rubidium
2012-10-17 19:15:23 +00:00
parent ec3e1b8846
commit 13b2ec1daf
4 changed files with 56 additions and 24 deletions

View File

@@ -218,7 +218,7 @@ bool HandleBootstrap()
if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure;
/* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */
#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && !defined(__APPLE__)
#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && !defined(__APPLE__) && (defined(WITH_FONTCONFIG) || defined(WIN32))
if (!_network_available) goto failure;
/* First tell the game we're bootstrapping. */

View File

@@ -62,6 +62,24 @@ void StringParameters::ClearTypeInformation()
MemSetT(this->type, 0, this->num_param);
}
/**
* Read an int64 from the argument array. The offset is increased
* so the next time GetInt64 is called the next value is read.
*/
int64 StringParameters::GetInt64(WChar type)
{
if (this->offset >= this->num_param) {
DEBUG(misc, 0, "Trying to read invalid string parameter");
return 0;
}
if (this->type != NULL) {
assert(this->type[this->offset] == 0 || this->type[this->offset] == type);
this->type[this->offset] = type;
}
return this->data[this->offset++];
}
/**
* Shift all data in the data array by the given amount to make
* room for some extra parameters.
@@ -781,7 +799,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
}
int i = 0;
while (*p != '\0') {
while (*p != '\0' && i < 20) {
uint64 param;
s = ++p;

View File

@@ -73,19 +73,7 @@ public:
void ClearTypeInformation();
/**
* Read an int64 from the argument array. The offset is increased
* so the next time GetInt64 is called the next value is read.
*/
int64 GetInt64(WChar type = 0)
{
assert(this->offset < this->num_param);
if (this->type != NULL) {
assert(this->type[this->offset] == 0 || this->type[this->offset] == type);
this->type[this->offset] = type;
}
return this->data[this->offset++];
}
int64 GetInt64(WChar type = 0);
/** Read an int32 from the argument array. @see GetInt64. */
int32 GetInt32(WChar type = 0)