diff options
author | Benjamin Berg <bberg@redhat.com> | 2020-04-24 17:56:45 +0200 |
---|---|---|
committer | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2020-04-24 20:03:37 +0200 |
commit | 5d5995f2015acb9120cad4d3ccfbc61b9376e12e (patch) | |
tree | 847ead3fc02fe8da80e826933fccb01a2a67d199 | |
parent | f71045b7431140f2ab069388e438fd3410711ea5 (diff) |
image: Check for task success rather than just cancellation
The minutiae detection might fail and we must not copy any data at that
point. So check g_task_had_error to ensure that we only do so when the
task was successful.
Fixes: #251
-rw-r--r-- | libfprint/fp-image.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libfprint/fp-image.c b/libfprint/fp-image.c index ac70d68..0bcee64 100644 --- a/libfprint/fp-image.c +++ b/libfprint/fp-image.c @@ -184,10 +184,8 @@ fp_image_detect_minutiae_cb (GObject *source_object, GTask *task = G_TASK (res); FpImage *image; DetectMinutiaeData *data = g_task_get_task_data (task); - GCancellable *cancellable; - cancellable = g_task_get_cancellable (task); - if (!cancellable || !g_cancellable_is_cancelled (cancellable)) + if (!g_task_had_error (task)) { gint i; image = FP_IMAGE (source_object); |