Skip to content

Commit 31defcb

Browse files
committed
Fix crash on startup due to uninitialized background texture ID
- Manually assigned OpenGL texture ID to backgroundImage in initTextures(). - Registered the texture with OpenGL via setTextureLookup(), as done for other manual textures. - Resolves assertion failure in getId() when background image was enabled.
1 parent 053dd05 commit 31defcb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/display/Textures.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ void MapCanvas::initTextures()
257257

258258
textures.backgroundImage = loadTexture(getPixmapFilenameRaw("background-image.png"));
259259

260+
if (textures.backgroundImage) {
261+
auto &tex = deref(textures.backgroundImage);
262+
const auto id = allocateTextureId();
263+
tex.setId(id);
264+
m_opengl.setTextureLookup(id, textures.backgroundImage);
265+
}
266+
260267

261268
{
262269
textures.for_each([this](SharedMMTexture &pTex) -> void {

0 commit comments

Comments
 (0)