1
0
Fork 0

Increase ARRAY_SIZE_1 (previous value was too low and genapts would crash processing ENAL).

Add some code to catch this issue and abort with a helpful error message next time.
This commit is contained in:
Maxime Guillaud 2011-10-19 23:13:04 +02:00 committed by Christian Schmitt
parent 881c4e131b
commit fd597739ea
2 changed files with 6 additions and 1 deletions

View file

@ -131,6 +131,11 @@ TGArray::parse( SGBucket& b ) {
SG_LOG(SG_GENERAL, SG_DEBUG, " cols = " << cols << " rows = " << rows );
SG_LOG(SG_GENERAL, SG_DEBUG, " col_step = " << col_step << " row_step = " << row_step );
if ((cols>ARRAY_SIZE_1) || (rows>ARRAY_SIZE_1)) {
cout << "error, ARRAY_SIZE_1=" << ARRAY_SIZE_1 <<" is too small (cols=" << cols << ", rows=" << rows << "), aborting." << endl;
exit(-1);
}
for ( int i = 0; i < cols; i++ ) {
for ( int j = 0; j < rows; j++ ) {
*array_in >> in_data[i][j];

View file

@ -40,7 +40,7 @@
#include <simgear/math/sg_types.hxx>
#include <simgear/misc/sgstream.hxx>
#define ARRAY_SIZE_1 1201
#define ARRAY_SIZE_1 20000
class TGArray {