nbis: Apply patch to fix scan-build warnings

Apply the newly added patch to the checkout.
This commit is contained in:
Benjamin Berg 2020-05-04 16:01:16 +02:00 committed by Benjamin Berg
parent ad17011e68
commit a464f602ca
4 changed files with 10 additions and 2 deletions

View file

@ -440,6 +440,8 @@ int get_centered_contour(int **ocontour_x, int **ocontour_y,
int *contour_x, *contour_y, *contour_ex, *contour_ey, ncontour;
int i, j, ret;
g_assert (half_contour > 0);
/* Compute maximum length of complete contour */
/* (2 half contours + feature point). */
max_contour = (half_contour<<1) + 1;

View file

@ -1625,7 +1625,7 @@ int process_horizontal_scan_minutia_V2(MINUTIAE *minutiae,
dmapval, bdata, iw, ih, lfsparms);
/* If minuitia IGNORED and not added to the minutia list ... */
if(ret == IGNORE)
if(ret != 0)
/* Deallocate the minutia. */
free_minutia(minutia);
@ -1776,7 +1776,7 @@ int process_vertical_scan_minutia_V2(MINUTIAE *minutiae,
dmapval, bdata, iw, ih, lfsparms);
/* If minuitia IGNORED and not added to the minutia list ... */
if(ret == IGNORE)
if(ret != 0)
/* Deallocate the minutia. */
free_minutia(minutia);

View file

@ -147,6 +147,8 @@ int count_minutia_ridges(const int first, MINUTIAE *minutiae,
{
int i, ret, *nbr_list, *nbr_nridges, nnbrs;
g_assert (lfsparms->max_nbrs > 0);
/* Find up to the maximum number of qualifying neighbors. */
nbr_list = NULL;
if((ret = find_neighbors(&nbr_list, &nnbrs, lfsparms->max_nbrs,
@ -407,6 +409,8 @@ int insert_neighbor(const int pos, const int nbr_index, const double nbr_dist2,
{
int i;
g_assert (pos >= 0);
/* If the desired insertion position is beyond one passed the last */
/* neighbor in the lists OR greater than equal to the maximum ... */
/* NOTE: pos is zero-oriented while nnbrs and max_nbrs are 1-oriented. */

View file

@ -81,6 +81,8 @@ test_frame_assembling (void)
ctx.frame_height = 20;
ctx.image_width = width;
g_assert (height > ctx.frame_height);
offset = 10;
test_height = height - (height - ctx.frame_height) % offset;