[vlc-commits] opengl: fix memory leak in obscure PBO failure case

Niklas Haas git at videolan.org
Sun Dec 16 21:41:03 CET 2018


vlc/vlc-3.0 | branch: master | Niklas Haas <git at haasn.xyz> | Fri Oct  5 21:07:51 2018 +0200| [7c6101925303b7f8877f99295d97c336b3e655dd] | committer: Jean-Baptiste Kempf

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>
(cherry picked from commit 2f90ab90ad3bf8e47caadbbbd8177582162a3c6c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7c6101925303b7f8877f99295d97c336b3e655dd
---

 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 4cf53fa07f..e48b800573 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -155,7 +155,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