docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
[platform/upstream/gstreamer.git] / gst / gstmemory.c
index 586da2f..d5811f6 100644 (file)
@@ -33,7 +33,7 @@
  * in the allocated region.
  *
  * Memory is usually created by allocators with a gst_allocator_alloc()
- * method call. When NULL is used as the allocator, the default allocator will
+ * method call. When %NULL is used as the allocator, the default allocator will
  * be used.
  *
  * New allocators can be registered with gst_allocator_register().
@@ -59,9 +59,7 @@
  * memory with an existing memory block at a custom offset and with a custom
  * size.
  *
- * Memory can be efficiently merged when gst_memory_is_span() returns TRUE.
- *
- * Last reviewed on 2012-03-28 (0.11.3)
+ * Memory can be efficiently merged when gst_memory_is_span() returns %TRUE.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -226,7 +224,7 @@ gst_memory_resize (GstMemory * mem, gssize offset, gsize size)
  * This function takes ownership of old @mem and returns a reference to a new
  * #GstMemory.
  *
- * Returns: (transfer full): a #GstMemory object mapped with @flags or NULL when
+ * Returns: (transfer full): a #GstMemory object mapped with @flags or %NULL when
  * a mapping is not possible.
  */
 GstMemory *
@@ -310,6 +308,7 @@ gst_memory_map (GstMemory * mem, GstMapInfo * info, GstMapFlags flags)
 lock_failed:
   {
     GST_CAT_DEBUG (GST_CAT_MEMORY, "mem %p: lock %d failed", mem, flags);
+    memset (info, 0, sizeof (GstMapInfo));
     return FALSE;
   }
 error:
@@ -317,6 +316,7 @@ error:
     /* something went wrong, restore the orginal state again */
     GST_CAT_ERROR (GST_CAT_MEMORY, "mem %p: subclass map failed", mem);
     gst_memory_unlock (mem, (GstLockFlags) flags);
+    memset (info, 0, sizeof (GstMapInfo));
     return FALSE;
   }
 }