Browse Source

glgsg: Fix possibility of simple RAM image going out of scope

rdb 4 years ago
parent
commit
54de9f9fa4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx

+ 2 - 1
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;
   }