From 54de9f9fa41ebedfc3ec4818cfca7e4730a50028 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 28 Nov 2021 13:57:20 +0100 Subject: [PATCH] glgsg: Fix possibility of simple RAM image going out of scope --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 8aba915666..54a62e10bb 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -13853,7 +13853,8 @@ upload_simple_texture(CLP(TextureContext) *gtc) { #endif GLenum external_format = GL_BGRA; - const unsigned char *image_ptr = tex->get_simple_ram_image(); + CPTA_uchar image = tex->get_simple_ram_image(); + const unsigned char *image_ptr = image.p(); if (image_ptr == nullptr) { return false; }