mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-02-08 17:30:30 +01:00
add error check for crfpmoc_fp_download_template
This commit is contained in:
parent
a951ab813c
commit
885930769b
1 changed files with 14 additions and 2 deletions
|
|
@ -800,6 +800,7 @@ static void handle_enroll_commit(FpiSsm *ssm, FpDevice *device,
|
|||
guint8 *template = NULL;
|
||||
guint16 ec_max_outsize = 10;
|
||||
struct crfpmoc_ec_response_fp_info info;
|
||||
gboolean r = 0;
|
||||
|
||||
crfpmoc_cmd_fp_info(self, &enrolled_templates, &error);
|
||||
fp_dbg("Number of enrolled templates is: %d", enrolled_templates);
|
||||
|
|
@ -809,9 +810,20 @@ static void handle_enroll_commit(FpiSsm *ssm, FpDevice *device,
|
|||
|
||||
g_object_set(enroll_print->print, "description", user_id, NULL);
|
||||
|
||||
gboolean r = crfpmoc_fp_download_template(self, &info, enrolled_templates - 1,
|
||||
&template, &error);
|
||||
r = crfpmoc_ec_max_outsize(self, &ec_max_outsize, &error);
|
||||
if (!r) {
|
||||
fp_err("Failed to get max outsize");
|
||||
crfpmoc_set_print_data(enroll_print->print, enrolled_templates - 1, NULL, 0,
|
||||
ec_max_outsize, info.template_max);
|
||||
fpi_ssm_mark_failed(
|
||||
ssm, fpi_device_retry_new_msg(FP_DEVICE_RETRY_GENERAL,
|
||||
"Failed to get max outsize"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
r = crfpmoc_fp_download_template(self, &info, enrolled_templates - 1,
|
||||
&template, &error);
|
||||
|
||||
if (!r) {
|
||||
fp_err("Failed to download template");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue