[TensorMerge] Fix gst_buffer_unref error (#732)
authorJijoong Moon <jijoong.moon@samsung.com>
Wed, 31 Oct 2018 09:11:57 +0000 (18:11 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Wed, 31 Oct 2018 09:11:57 +0000 (09:11 +0000)
* [TensorMerge] Fix gst_buffer_unref error

Fix gst_buffer_unref bug.
If this call exist, pad->buffer will be invalid.

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
gst/tensor_merge/gsttensormerge.c

index 6e7ce06..dfd8b26 100644 (file)
@@ -524,6 +524,9 @@ gst_tensor_merge_collect_buffer (GstTensorMerge * tensor_merge,
       } else {
         gst_buffer_unref (buf);
         buf = gst_collect_pads_pop (tensor_merge->collect, data);
+        if (pad->buffer != NULL)
+          gst_buffer_unref (pad->buffer);
+        pad->buffer = buf;
       }
     } else {
       buf = pad->buffer;
@@ -540,7 +543,6 @@ gst_tensor_merge_collect_buffer (GstTensorMerge * tensor_merge,
       *dts_time = bestpad->dts_timestamp;
     }
 
-    gst_buffer_unref (buf);
     tensor_merge->tensors_config.info.info[counting] = config.info;
     counting++;
   }