tizenwlsink: wlbuffer point check for mapping sub surface (fix coverity issue) 12/177712/1 accepted/tizen/unified/20180504.162619 submit/tizen/20180503.065531
authorHyunil <hyunil46.park@samsung.com>
Thu, 3 May 2018 06:28:49 +0000 (15:28 +0900)
committerHyunil <hyunil46.park@samsung.com>
Thu, 3 May 2018 06:28:49 +0000 (15:28 +0900)
Change-Id: I40aac6a686da3dd36de77c9bb1c6228320434035
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
tizenwlsink/src/wlwindow.c

index c8333e6..b2b934a 100644 (file)
@@ -145,9 +145,15 @@ gst_wl_window_map_sub_surface (GstWlDisplay * display, GstWlWindow * window,
   gst_buffer_map (buf, &mapinfo, GST_MAP_WRITE);
   *((guint32 *) mapinfo.data) = 0;      /* paint it black */
   gst_buffer_unmap (buf, &mapinfo);
+
   wlbuf =
       gst_tizen_wl_shm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf,
           0), display, info);
+  if (G_UNLIKELY (!wlbuf)) {
+      GST_ERROR ("could not create wl_buffer");
+      gst_buffer_unref (buf);
+      return;
+  }
 
   gwlbuf = gst_buffer_add_wl_buffer (buf, wlbuf, display);
   gst_wl_buffer_attach (gwlbuf, window->area_surface);