stime has only 19 items. So the for loop should stop at 18, not 19.
From: Erik Hovland <erik@hovland.org>
---
libs/libmythdvdnav/searching.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libs/libmythdvdnav/searching.c b/libs/libmythdvdnav/searching.c
index 4667d3f..d436011 100644
a
|
b
|
dvdnav_status_t dvdnav_time_search_within_cell(dvdnav_t *this, |
690 | 690 | { |
691 | 691 | dsi = dvdnav_get_current_nav_dsi(this); |
692 | 692 | if (length > 0) { |
693 | | for (i = 1; i <= 19; i++) { |
694 | | if (stime[i]/2.0 <= length/2.0) { |
695 | | offset = dsi->vobu_sri.fwda[i]; |
| 693 | for (i = 1; i < 20; i++) { |
| 694 | if (stime[i-1]/2.0 <= length/2.0) { |
| 695 | offset = dsi->vobu_sri.fwda[i-1]; |
696 | 696 | if (offset >> 31) { |
697 | 697 | new_vobu = cur_vobu + (offset & 0xffff); |
698 | 698 | } else { |
… |
… |
dvdnav_status_t dvdnav_time_search_within_cell(dvdnav_t *this, |
708 | 708 | } |
709 | 709 | } |
710 | 710 | } else { |
711 | | for (i = 1; i <= 19; i++) { |
712 | | if (stime[18 - i]/2.0 >= abs(length)/2.0) |
| 711 | for (i = 1; i < 20; i++) { |
| 712 | if (stime[19 - i]/2.0 >= abs(length)/2.0) |
713 | 713 | { |
714 | | offset = dsi->vobu_sri.bwda[i]; |
| 714 | offset = dsi->vobu_sri.bwda[i-1]; |
715 | 715 | if (offset >> 31) { |
716 | 716 | new_vobu = cur_vobu - (offset & 0xffff); |
717 | 717 | } else { |