Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i.segment: Fix uninitialized variable issue #4023

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions imagery/i.segment/region_growing.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static int find_best_neighbor(struct ngbr_stats *Ri, struct reg_stats *Ri_rs,
int clear_cand, struct globals *globals)
{
int n, n_ngbrs, no_check, cmp;
struct rc ngbr_rc, next, *pngbr_rc;
struct rc ngbr_rc = {0}, next = {0}, *pngbr_rc = NULL;
struct rclist rilist;
double tempsim;
int neighbors[8][2];
Expand Down Expand Up @@ -893,7 +893,7 @@ double calculate_shape(struct reg_stats *rsi, struct reg_stats *rsk,
double smooth, compact;
int pl, pbbox, count;
double bboxdiag;
int pl1, pl2, count1, count2;
int pl1 = 0, pl2 = 0, count1 = 0, count2 = 0;
int e1, n1, s1, w1, e2, n2, s2, w2, ns_extent, ew_extent;

pl = pl1 + pl2 - nshared;
Expand Down Expand Up @@ -989,7 +989,7 @@ static int search_neighbors(struct ngbr_stats *Ri, struct reg_stats *Ri_rs,
int update_band_vals(int row, int col, struct reg_stats *rs,
struct globals *globals)
{
struct rc next, ngbr_rc;
struct rc next = {0}, ngbr_rc = {0};
int neighbors[8][2];
int rid, count, n;

Expand Down Expand Up @@ -1498,7 +1498,7 @@ static int calculate_reg_stats(int row, int col, struct reg_stats *rs,
ret = 1;
else if (globals->min_reg_size == 3) {
int n, rid;
struct rc ngbr_rc;
struct rc ngbr_rc = {0};
int neighbors[8][2];

globals->find_neighbors(row, col, neighbors);
Expand Down Expand Up @@ -1541,7 +1541,7 @@ static int calculate_reg_stats(int row, int col, struct reg_stats *rs,
/* rs->id must be set */
struct pavl_table *rc_check_tree; /* cells already checked */
int n, rid;
struct rc ngbr_rc, *pngbr_rc, next;
struct rc ngbr_rc = {0}, *pngbr_rc = NULL, next ={0};
ShubhamDesai marked this conversation as resolved.
Show resolved Hide resolved
struct rclist rilist;
int neighbors[8][2];
int no_check;
Expand Down
Loading