From cc3b85445f48d071a9461f0e8ab1078bf98fed5a Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 13 Jun 2014 16:42:04 -0400 Subject: [PATCH] memory bug fix --- openbr/plugins/gallery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index b51f73d..95b42f7 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -214,7 +214,7 @@ class utGallery : public BinaryGallery QDataStream stream(&data, QIODevice::ReadOnly); stream >> t; } else { - t.append(cv::Mat(1, data.size(), CV_8UC1, data.data())); + t.append(cv::Mat(1, data.size(), CV_8UC1, data.data()).clone() /* We don't want a shallow copy! */); } t.file.set("ImageID", QVariant(QByteArray((const char*)ut->imageID, 16).toHex())); -- libgit2 0.21.4