From 51f10c512e7ee114f32e7e8323ea3b61c20e3255 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Sep 2016 13:53:12 +0200 Subject: [PATCH] vo_opengl: rpi: fix glaring memory leak This was in previously inactive code (uploading yuv420p), so it did not matter. --- video/out/opengl/hwdec_rpi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/video/out/opengl/hwdec_rpi.c b/video/out/opengl/hwdec_rpi.c index 6204f461d1..fdcd850138 100644 --- a/video/out/opengl/hwdec_rpi.c +++ b/video/out/opengl/hwdec_rpi.c @@ -328,9 +328,12 @@ static int overlay_frame(struct gl_hwdec *hw, struct mp_image *hw_image) update_overlay(hw, true); - struct mp_image *mpi = mp_image_new_ref(hw_image); - if (hw_image->imgfmt != IMGFMT_MMAL) + struct mp_image *mpi = NULL; + if (hw_image->imgfmt == IMGFMT_MMAL) { + mpi = mp_image_new_ref(hw_image); + } else { mpi = upload(hw, hw_image); + } if (!mpi) { disable_renderer(hw);