mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
image: Return an error if we got an empty or NULL minutiae array
In some cases nbim's get_minutiae returns no minutiae without providing an error code, and if this happens we would crash in the task callback function as we would try to deference the data->minutiae pointer. Related to: #251
This commit is contained in:
@@ -314,6 +314,14 @@ fp_image_detect_minutiae_thread_func (GTask *task,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data->minutiae || data->minutiae->num == 0)
|
||||
{
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"No minutiae found");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user