[vlc-commits] mmal/deinterlace: Free unusable buffers

Julian Scheel git at videolan.org
Fri Jun 5 15:37:16 CEST 2015


vlc | branch: master | Julian Scheel <julian at jusst.de> | Wed Jun  3 09:50:37 2015 +0200| [b2cf46dd2242bea3388fcd016f49c368a28208f6] | committer: Jean-Baptiste Kempf

mmal/deinterlace: Free unusable buffers

If the input port returns a buffer which has no picture attached to it it
would be leaked. While this in fact should not happen it seems sane to at
least release the buffer and spit a warning in case it does happen.

Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/hw/mmal/deinterlace.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index 0a56a94..9f06ead 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -432,8 +432,12 @@ static void input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
     filter_sys_t *sys = filter->p_sys;
 
     vlc_mutex_lock(&sys->buffer_cond_mutex);
-    if (picture)
+    if (picture) {
         picture_Release(picture);
+    } else {
+        msg_Warn(filter, "Got buffer without picture on input port - OOOPS");
+        mmal_buffer_header_release(buffer);
+    }
 
     atomic_fetch_sub(&sys->input_in_transit, 1);
     vlc_cond_signal(&sys->buffer_cond);



More information about the vlc-commits mailing list