Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when loading stupid roadtypes newgrf #8166

Closed
FLHerne opened this issue May 22, 2020 · 3 comments
Closed

Crash when loading stupid roadtypes newgrf #8166

FLHerne opened this issue May 22, 2020 · 3 comments

Comments

@FLHerne
Copy link
Contributor

FLHerne commented May 22, 2020

Version of OpenTTD

1.10.1

Expected result

No crash

Actual result

OpenTTD crashes after clicking 'Generate' in the new game dialog.

Steps to reproduce

Load the attached GRF and start a new game.

The grf is a quick hack while trying to reproduce OpenTTD/nml#147 and is probably severely buggy in some way, but shouldn't be able to crash the game.

Crash log:
crash.log

Stupid grf:
roads-test.zip

@FLHerne
Copy link
Contributor Author

FLHerne commented May 22, 2020

The grf fails to define a label for the roadtypes. When adding a label, OpenTTD refrains from instantly crashing.

@glx22
Copy link
Contributor

glx22 commented May 22, 2020

Indeed a newgrf should not crash the game.

@FLHerne
Copy link
Contributor Author

FLHerne commented May 22, 2020

The issue doesn't occur with a roughly-identical railtype grf.

Yexo added a commit to Yexo/OpenTTD that referenced this issue Jun 1, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
Yexo added a commit to Yexo/OpenTTD that referenced this issue Jun 1, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
@Yexo Yexo closed this as completed in f827bc8 Jun 1, 2020
LordAro pushed a commit to LordAro/OpenTTD that referenced this issue Jun 1, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
LordAro pushed a commit to LordAro/OpenTTD that referenced this issue Jun 1, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
LordAro pushed a commit that referenced this issue Jun 1, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
freprec pushed a commit to freprec/OpenTTD that referenced this issue Jun 19, 2020
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants