Index: trunk/psLib/src/types/psMetadata.c
===================================================================
--- trunk/psLib/src/types/psMetadata.c	(revision 41412)
+++ trunk/psLib/src/types/psMetadata.c	(revision 41415)
@@ -439,4 +439,8 @@
 {
     PS_ASSERT_METADATA_NON_NULL(in, NULL);
+
+    // if calling function passes the same psMetadata for in and out, we are done
+    // otherwise, we get stuck in an infinite loop
+    if (out == in) return out;
 
     bool errorOccurred = false;
