summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch')
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch b/meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch
new file mode 100644
index 0000000000..b02a2169a6
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/CVE-2022-4743.patch
@@ -0,0 +1,38 @@
1From 00b67f55727bc0944c3266e2b875440da132ce4b Mon Sep 17 00:00:00 2001
2From: zhailiangliang <zhailiangliang@loongson.cn>
3Date: Wed, 21 Sep 2022 10:30:38 +0800
4Subject: [PATCH] Fix potential memory leak in GLES_CreateTexture
5
6
7CVE: CVE-2022-4743
8Upstream-Status: Backport [https://github.com/libsdl-org/SDL/commit/00b67f55727bc0944c3266e2b875440da132ce4b.patch]
9Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
10
11---
12 src/render/opengles/SDL_render_gles.c | 6 ++++++
13 1 file changed, 6 insertions(+)
14
15diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
16index a5fbab309eda..ba08a46e2805 100644
17--- a/src/render/opengles/SDL_render_gles.c
18+++ b/src/render/opengles/SDL_render_gles.c
19@@ -359,6 +359,9 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
20 renderdata->glGenTextures(1, &data->texture);
21 result = renderdata->glGetError();
22 if (result != GL_NO_ERROR) {
23+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
24+ SDL_free(data->pixels);
25+ }
26 SDL_free(data);
27 return GLES_SetError("glGenTextures()", result);
28 }
29@@ -387,6 +390,9 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
30
31 result = renderdata->glGetError();
32 if (result != GL_NO_ERROR) {
33+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
34+ SDL_free(data->pixels);
35+ }
36 SDL_free(data);
37 return GLES_SetError("glTexImage2D()", result);
38 }