Fixed a memory leak in function GL_RenderReadPixels

This commit is contained in:
Steffen Pankratz 2016-10-11 17:31:29 +02:00
parent fed9b60492
commit 564c790f33

View File

@ -1438,6 +1438,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
} }
if (!convert_format(data, temp_format, &internalFormat, &format, &type)) { if (!convert_format(data, temp_format, &internalFormat, &format, &type)) {
SDL_free(temp_pixels);
return SDL_SetError("Texture format %s not supported by OpenGL", return SDL_SetError("Texture format %s not supported by OpenGL",
SDL_GetPixelFormatName(temp_format)); SDL_GetPixelFormatName(temp_format));
} }