From 0fba95a7b1fa96a71a5f472d06a53832fc6be141 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 29 Jun 2012 18:54:51 +0200 Subject: [PATCH] videooverlaycomposition: fix some refcounting and avoid possible NULL use --- gst-libs/gst/video/video-overlay-composition.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-overlay-composition.c b/gst-libs/gst/video/video-overlay-composition.c index 8c941f0ed3..d614ba045f 100644 --- a/gst-libs/gst/video/video-overlay-composition.c +++ b/gst-libs/gst/video/video-overlay-composition.c @@ -328,7 +328,9 @@ gst_video_buffer_set_overlay_composition (GstBuffer * buf, ometa = (GstVideoOverlayCompositionMeta *) gst_buffer_add_meta (buf, GST_VIDEO_OVERLAY_COMPOSITION_META_INFO, NULL); - ometa->overlay = comp; + /* buffer might not be writable or so */ + if (ometa) + ometa->overlay = gst_video_overlay_composition_ref (comp); } }