From bc866de22a755ec70e16f667ac110099e1797b95 Mon Sep 17 00:00:00 2001 From: hack Date: Sat, 6 Jul 2024 19:00:50 -0500 Subject: [PATCH 1/2] check if active preset output texture is valid before copying --- src/libprojectM/ProjectM.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libprojectM/ProjectM.cpp b/src/libprojectM/ProjectM.cpp index 37e5f41a59..5095e6f2c3 100644 --- a/src/libprojectM/ProjectM.cpp +++ b/src/libprojectM/ProjectM.cpp @@ -242,7 +242,10 @@ void ProjectM::StartPresetTransition(std::unique_ptr&& preset, bool hard if (m_activePreset) { - preset->DrawInitialImage(m_activePreset->OutputTexture(), GetRenderContext()); + auto outputTexture = m_activePreset->OutputTexture(); + if (outputTexture->Type() != 0) { + preset->DrawInitialImage(outputTexture, GetRenderContext()); + } } if (hardCut) From 8d5f6077611fb612059ff2b68ef34e8fa188be3c Mon Sep 17 00:00:00 2001 From: hack Date: Sat, 6 Jul 2024 19:27:57 -0500 Subject: [PATCH 2/2] added comment with details --- src/libprojectM/ProjectM.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libprojectM/ProjectM.cpp b/src/libprojectM/ProjectM.cpp index 5095e6f2c3..475f37f5d3 100644 --- a/src/libprojectM/ProjectM.cpp +++ b/src/libprojectM/ProjectM.cpp @@ -243,6 +243,9 @@ void ProjectM::StartPresetTransition(std::unique_ptr&& preset, bool hard if (m_activePreset) { auto outputTexture = m_activePreset->OutputTexture(); + + // Check if the output texture is valid by testing if the OpenGL texturing target enum has been initialized. + // In case of the initial preset transition, it is 0. if (outputTexture->Type() != 0) { preset->DrawInitialImage(outputTexture, GetRenderContext()); }