mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Merge #3956
3956: Fix out of bounds in editor render image r=heinrich5991 a=Jupeyy ## 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 if it works standalone, system.c especially - [ ] 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: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
95c936d6c9
|
@ -3956,7 +3956,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View)
|
|||
|
||||
// render image
|
||||
int i = m_SelectedImage;
|
||||
if(i < m_Map.m_lImages.size())
|
||||
if(i != -1 && i < m_Map.m_lImages.size())
|
||||
{
|
||||
CUIRect r;
|
||||
View.Margin(10.0f, &r);
|
||||
|
|
Loading…
Reference in a new issue