sources: check for negative distance
This is not expected to happen, but make sure the endpoints of each source are in the right order (i.e. the distance is not negative) to prevent getting a negative depth in the selection.
This commit is contained in:
parent
faff931a76
commit
ed78cda6ad
1 changed files with 3 additions and 2 deletions
|
@ -828,8 +828,9 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
||||||
si->hi_limit += extra_disp;
|
si->hi_limit += extra_disp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Require the root distance to be below the allowed maximum */
|
/* Require the root distance to be below the allowed maximum and the
|
||||||
if (si->root_distance > max_distance) {
|
endpoints to be in the right order (i.e. a non-negative distance) */
|
||||||
|
if (!(si->root_distance <= max_distance && si->lo_limit <= si->hi_limit)) {
|
||||||
mark_source(sources[i], SRC_BAD_DISTANCE);
|
mark_source(sources[i], SRC_BAD_DISTANCE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue