summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexia Death <alexiadeath@gmail.com>2009-12-25 23:00:59 (GMT)
committerBastien Nocera <hadess@hadess.net>2010-08-19 19:21:51 (GMT)
commit4b518bd230ef0f3a26c8eb89736815ed9334b6bb (patch)
tree0b28385e838394745c0bdc843c4b61f9a428cf33
parentdaee067c4ffabff9836617b90c547873130087f1 (diff)
Fix a segfault if a scan was shorter than 8 lines.
This segfault was caused by proceeding to free the conversion result without checking for an error condition in image to print data conversion. http://lists.reactivated.net/pipermail/fprint/2009-December/001405.html
-rw-r--r--libfprint/imgdev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libfprint/imgdev.c b/libfprint/imgdev.c
index 4b49c73..b365d74 100644
--- a/libfprint/imgdev.c
+++ b/libfprint/imgdev.c
@@ -228,8 +228,12 @@ void fpi_imgdev_image_captured(struct fp_img_dev *imgdev, struct fp_img *img)
fp_img_standardize(img);
imgdev->acquire_img = img;
- fpi_img_to_print_data(imgdev, img, &print);
- if (img->minutiae->num < MIN_ACCEPTABLE_MINUTIAE) {
+ r = fpi_img_to_print_data(imgdev, img, &print);
+ if (r < 0) {
+ fp_dbg("image to print data conversion error: %d", r);
+ imgdev->action_result = FP_ENROLL_RETRY;
+ goto next_state;
+ } else if (img->minutiae->num < MIN_ACCEPTABLE_MINUTIAE) {
fp_dbg("not enough minutiae, %d/%d", img->minutiae->num,
MIN_ACCEPTABLE_MINUTIAE);
fp_print_data_free(print);