omxvideodec: Check return value of gst_buffer_map()
authorSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 07:06:42 +0000 (09:06 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 07:06:42 +0000 (09:06 +0200)
CID 1214599

omx/gstomxvideodec.c

index 2536d82..079f0a9 100644 (file)
@@ -432,7 +432,11 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self,
   if (gst_buffer_get_size (outbuf) == inbuf->omx_buf->nFilledLen) {
     GstMapInfo map = GST_MAP_INFO_INIT;
 
-    gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
+    if (!gst_buffer_map (outbuf, &map, GST_MAP_WRITE)) {
+      GST_ERROR_OBJECT (self, "Failed to map output buffer");
+      goto done;
+    }
+
     memcpy (map.data,
         inbuf->omx_buf->pBuffer + inbuf->omx_buf->nOffset,
         inbuf->omx_buf->nFilledLen);