Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6168)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6169)
@@ -10,6 +10,4 @@
     PS_ASSERT_PTR_NON_NULL(rawFrames, false);
 
-    psMetadata *where = psMetadataAlloc();
-
     // can we use p2rawToPending() here?
     for (int i = 0; i < rawFrames->n; i++) {
@@ -17,8 +15,17 @@
 
         // find the next available version numbers
+        // broken
+        /*
+        psMetadata *where = psMetadataAlloc();
+
         psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==",
             rawFrame->exposure->exp_id);
         psArray *exposures = p2PendingExpSelectRowObjects(config->database,
             where, MAX_ROWS);
+        psFree(where);
+        if (!exposures) {
+            psError(PS_ERR_UNKNOWN, false, "no p2PedningExps found");
+            return false;
+        }
 
         int version = -1;
@@ -28,4 +35,5 @@
         }
         version ++;
+        */
 
         p2PendingExpRow *pendingExposure = p2PendingExpRowAlloc(
@@ -36,7 +44,6 @@
             rawFrame->exposure->nclass,
             0xff,
-            version
+            0xff
             // pendingExposure->Ndone = 0;
-            // pendingExposure->state = P2_STATE_PENDING;
         );
 
@@ -50,6 +57,6 @@
                 rawImage->class,
                 rawImage->class_id,
-                version, // p1
-                version, // p2
+                0xff, // p1
+                0xff, // p2
                 "",
                 "",
