6408: Fix some potentially undefined editor member variables r=def- a=Robyt3

See #6407.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
bors[bot] 2023-03-10 17:13:43 +00:00 committed by GitHub
commit 658dcb5ae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -96,6 +96,7 @@ CEditorSound::~CEditorSound()
CLayerGroup::CLayerGroup()
{
m_vpLayers.clear();
m_aName[0] = 0;
m_Visible = true;
m_Collapse = false;

View file

@ -301,6 +301,7 @@ public:
{
m_pEditor = pEditor;
m_aName[0] = 0;
m_Texture.Invalidate();
m_External = 0;
m_Width = 0;
m_Height = 0;
@ -767,6 +768,13 @@ public:
m_pTextRender = nullptr;
m_pSound = nullptr;
m_EntitiesTexture.Invalidate();
m_FrontTexture.Invalidate();
m_TeleTexture.Invalidate();
m_SpeedupTexture.Invalidate();
m_SwitchTexture.Invalidate();
m_TuneTexture.Invalidate();
m_Mode = MODE_LAYERS;
m_Dialog = 0;
m_EditBoxActive = 0;
@ -799,6 +807,9 @@ public:
m_FileDialogOpening = false;
m_FilesSelectedIndex = -1;
m_FilePreviewImage.Invalidate();
m_PreviewImageIsLoaded = false;
m_SelectEntitiesImage = "DDNet";
m_WorldOffsetX = 0;
@ -838,6 +849,10 @@ public:
m_QuadKnifeActive = false;
m_QuadKnifeCount = 0;
m_CheckerTexture.Invalidate();
m_BackgroundTexture.Invalidate();
m_CursorTexture.Invalidate();
m_CommandBox = 0.0f;
m_aSettingsCommand[0] = 0;

View file

@ -18,6 +18,7 @@ CLayerTiles::CLayerTiles(int w, int h)
m_aName[0] = '\0';
m_Width = w;
m_Height = h;
m_Texture.Invalidate();
m_Image = -1;
m_Game = 0;
m_Color.r = 255;
@ -910,7 +911,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
m_pEditor->m_PopupEventType = m_pEditor->POPEVENT_IMAGEDIV16;
m_pEditor->m_PopupEventActivated = true;
m_Texture = IGraphics::CTextureHandle();
m_Texture.Invalidate();
m_Image = -1;
}
}