mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
buffer: Check return value of gst_memory_map()
Only do memory operations if the memory was succesfully map'ed https://bugzilla.gnome.org/show_bug.cgi?id=728326
This commit is contained in:
parent
44423e8af3
commit
f7cba27157
1 changed files with 6 additions and 1 deletions
|
@ -236,7 +236,12 @@ _get_merged_memory (GstBuffer * buffer, guint idx, guint length)
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue