glviewconvert: check pointer before dereferencing
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Mon, 14 Dec 2015 12:31:52 +0000 (12:31 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:12 +0000 (19:32 +0000)
priv->primary_out could be NULL, check before dereferencing it in
GST_BUFFER_FLAG_SET ()

CID 1308945

gst-libs/gst/gl/gstglviewconvert.c

index 3f36b40..9b1e410 100644 (file)
@@ -2209,11 +2209,13 @@ gst_gl_view_convert_get_output (GstGLViewConvert * viewconvert,
   }
 
   outbuf = priv->primary_out;
-  gst_buffer_copy_into (outbuf, priv->primary_in,
-      GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
-  GST_BUFFER_FLAG_SET (outbuf,
-      GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE |
-      GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW);
+  if (outbuf) {
+    gst_buffer_copy_into (outbuf, priv->primary_in,
+        GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
+    GST_BUFFER_FLAG_SET (outbuf,
+        GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE |
+        GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW);
+  }
 
   if (priv->auxilliary_out) {
     gst_buffer_copy_into (priv->auxilliary_out,