Commit 564c790f338ac6e76de79699f06150c370584001

Steffen Pankratz 2016-10-11T17:31:29

Fixed a memory leak in function GL_RenderReadPixels

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index df0fd05..85319ea 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -1438,6 +1438,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
     }
 
     if (!convert_format(data, temp_format, &internalFormat, &format, &type)) {
+        SDL_free(temp_pixels);
         return SDL_SetError("Texture format %s not supported by OpenGL",
                             SDL_GetPixelFormatName(temp_format));
     }