mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(GL) Deal with some potential memory leaks
This commit is contained in:
parent
c1b1ff46e0
commit
29e3c79e8b
@ -2780,10 +2780,23 @@ unsigned *height_p, size_t *pitch_p)
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
if (gl->hw_render_use)
|
||||
{
|
||||
buffer = malloc(pitch * height);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
buffer_texture = malloc(pitch * gl->tex_h);
|
||||
|
||||
if (!buffer_texture)
|
||||
{
|
||||
#ifdef HAVE_FBO
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
glGetTexImage(GL_TEXTURE_2D, 0,gl->texture_type, gl->texture_fmt, buffer_texture);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user