[vlc-commits] opengl: fix memory leak in obscure PBO failure case
Niklas Haas
git at videolan.org
Mon Oct 8 08:54:39 CEST 2018
vlc | branch: master | Niklas Haas <git at haasn.xyz> | Fri Oct 5 21:07:51 2018 +0200| [2f90ab90ad3bf8e47caadbbbd8177582162a3c6c] | committer: Thomas Guillem
opengl: fix memory leak in obscure PBO failure case
This basically doesn't happen in practice, but we should correctly free
the picture even in this failure path.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f90ab90ad3bf8e47caadbbbd8177582162a3c6c
---
modules/video_output/opengl/converter_sw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c
index 4a839079b3..6338a1a5c0 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -156,7 +156,10 @@ pbo_picture_create(const opengl_tex_converter_t *tc, bool direct_rendering)
if( p->i_pitch < 0 || p->i_lines <= 0 ||
(size_t)p->i_pitch > SIZE_MAX/p->i_lines )
+ {
+ picture_Release(pic);
return NULL;
+ }
picsys->bytes[i] = (p->i_pitch * p->i_lines) + 15 / 16 * 16;
}
return pic;
More information about the vlc-commits
mailing list