Commit d48f66e8 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Check if QMap is not null before to pass it to FaceTags API, to prevent Qt crash

CCBUGS: 335624
parent 32a3188f
......@@ -656,11 +656,17 @@ void DatabaseWriter::process(FacePipelineExtendedPackage::Ptr package)
for (int i=0; i<package->databaseFaces.size(); i++)
{
if (package->databaseFaces[i].roles & FacePipelineDatabaseFace::ForRecognition)
//&& !package->recognitionResults[i].isNull()) // comment out: Allow to overwrite existing recognition with new, possibly valid, "not recognized" status
{
int tagId = FaceTags::getOrCreateTagForIdentity(package->recognitionResults[i].attributes);
package->databaseFaces[i] = utils.changeSuggestedName(package->databaseFaces[i], tagId);
// Allow to overwrite existing recognition with new, possibly valid, "not recognized" status
int tagId = FaceTags::unknownPersonTagId();
if (!package->recognitionResults[i].isNull())
{
// Only perform this call if recognition as results, to prevent crash in QMap. See B.K.O #335624
tagId = FaceTags::getOrCreateTagForIdentity(package->recognitionResults[i].attributes);
}
package->databaseFaces[i] = utils.changeSuggestedName(package->databaseFaces[i], tagId);
package->databaseFaces[i].roles &= ~FacePipelineDatabaseFace::ForRecognition;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment