what's more, in get_previous_up_osd_before(), if arg n = 0, run into endless loop
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
}
int get_next_up_osd_after(int n) const {
+ if (get_max_osd() == 0)
+ return -1;
for (int i = n + 1; i != n; ++i) {
if (i >= get_max_osd())
i = 0;
}
int get_previous_up_osd_before(int n) const {
+ if (get_max_osd() == 0)
+ return -1;
for (int i = n - 1; i != n; --i) {
if (i < 0)
i = get_max_osd() - 1;