Only do memory operations if the memory was succesfully map'ed
https://bugzilla.gnome.org/show_bug.cgi?id=728326
guint8 *ptr;
result = gst_allocator_alloc (NULL, size, NULL);
- gst_memory_map (result, &dinfo, GST_MAP_WRITE);
+ if (result == NULL || !gst_memory_map (result, &dinfo, GST_MAP_WRITE)) {
+ GST_CAT_ERROR (GST_CAT_BUFFER, "Failed to map memory writable");
+ if (result)
+ gst_memory_unref (result);
+ return NULL;
+ }
ptr = dinfo.data;
left = size;