mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 18:38:07 +00:00
Merge tag 'v1.90.6' into tod
Tag 1.90.6 Git-EVTag-v0-SHA512: 1cca84a89332a674d822476e587e1d9f30dc11bfff13724548ec0be66ab32f910fb5e7a7c9403c9a813538fdd9e86661105af8e2a4865b0b30d301601c7bddab
This commit is contained in:
@@ -350,9 +350,9 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
g_autoptr(GPtrArray) templates = NULL;
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpPrint *print = NULL;
|
||||
GPtrArray *templates = NULL;
|
||||
gint cnt = 0;
|
||||
gboolean find = false;
|
||||
|
||||
@@ -365,15 +365,14 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
{
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
|
||||
templates = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
templates = g_ptr_array_sized_new (1);
|
||||
fpi_device_get_verify_data (device, &print);
|
||||
g_ptr_array_add (templates, g_object_ref_sink (print));
|
||||
|
||||
g_ptr_array_add (templates, print);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_get_identify_data (device, &templates);
|
||||
g_ptr_array_ref (templates);
|
||||
}
|
||||
for (cnt = 0; cnt < templates->len; cnt++)
|
||||
{
|
||||
|
||||
@@ -229,7 +229,7 @@ gx_proto_parse_header (
|
||||
|
||||
memcpy (pheader, buffer, sizeof (pack_header));
|
||||
|
||||
pheader->len = GUINT16_FROM_LE (*(buffer + 4));
|
||||
pheader->len = GUINT16_FROM_LE ( *(uint16_t *) (buffer + 4));
|
||||
pheader->len -= PACKAGE_CRC_SIZE;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1018,6 +1018,7 @@ fp_device_identify (FpDevice *device,
|
||||
g_autoptr(GTask) task = NULL;
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
FpMatchData *data;
|
||||
int i;
|
||||
|
||||
task = g_task_new (device, cancellable, callback, user_data);
|
||||
if (g_task_return_error_if_cancelled (task))
|
||||
@@ -1042,7 +1043,13 @@ fp_device_identify (FpDevice *device,
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
|
||||
data = g_new0 (FpMatchData, 1);
|
||||
data->gallery = g_ptr_array_ref (prints);
|
||||
/* We cannot store the gallery directly, because the ptr array may not own
|
||||
* a reference to each print. Also, the caller could in principle modify the
|
||||
* GPtrArray afterwards.
|
||||
*/
|
||||
data->gallery = g_ptr_array_new_full (prints->len, g_object_unref);
|
||||
for (i = 0; i < prints->len; i++)
|
||||
g_ptr_array_add (data->gallery, g_object_ref (g_ptr_array_index (prints, i)));
|
||||
data->match_cb = match_cb;
|
||||
data->match_data = match_data;
|
||||
data->match_destroy = match_destroy;
|
||||
|
||||
@@ -282,7 +282,7 @@ fp_image_detect_minutiae_thread_func (GTask *task,
|
||||
gint map_w, map_h;
|
||||
gint bw, bh, bd;
|
||||
gint r;
|
||||
g_autofree LFSPARMS *lfsparms;
|
||||
g_autofree LFSPARMS *lfsparms = NULL;
|
||||
|
||||
/* Normalize the image first */
|
||||
if (data->flags & FPI_IMAGE_H_FLIPPED)
|
||||
|
||||
@@ -808,6 +808,7 @@ fp_print_deserialize (const guchar *data,
|
||||
"device-id", device_id,
|
||||
"device-stored", device_stored,
|
||||
NULL);
|
||||
g_object_ref_sink (result);
|
||||
fpi_print_set_type (result, FPI_PRINT_NBIS);
|
||||
for (i = 0; i < g_variant_n_children (prints); i++)
|
||||
{
|
||||
@@ -857,6 +858,7 @@ fp_print_deserialize (const guchar *data,
|
||||
"device-stored", device_stored,
|
||||
"fpi-data", fp_data,
|
||||
NULL);
|
||||
g_object_ref_sink (result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -875,8 +877,7 @@ fp_print_deserialize (const guchar *data,
|
||||
return g_steal_pointer (&result);
|
||||
|
||||
invalid_format:
|
||||
*error = g_error_new_literal (G_IO_ERROR,
|
||||
G_IO_ERROR_INVALID_DATA,
|
||||
"Data could not be parsed");
|
||||
return FALSE;
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
|
||||
"Data could not be parsed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,6 @@ typedef enum {
|
||||
|
||||
FpPrint *fp_print_new (FpDevice *device);
|
||||
|
||||
FpPrint *fp_print_new_from_data (guchar *data,
|
||||
gsize length);
|
||||
gboolean fp_print_to_data (guchar **data,
|
||||
gsize length);
|
||||
|
||||
const gchar *fp_print_get_driver (FpPrint *print);
|
||||
const gchar *fp_print_get_device_id (FpPrint *print);
|
||||
FpImage *fp_print_get_image (FpPrint *print);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#if !GLIB_CHECK_VERSION (2, 57, 0)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GTypeClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GEnumClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GFlagsClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GParamSpec, g_param_spec_unref);
|
||||
#else
|
||||
/* Re-define G_SOURCE_FUNC as we are technically not allowed to use it with
|
||||
|
||||
Reference in New Issue
Block a user