summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS3
-rw-r--r--HISTORY5
-rw-r--r--osdbase.c14
3 files changed, 16 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index c8e27dd4..5e64f427 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1508,3 +1508,6 @@ Philip Prindeville <philipp_subx@redfish-solutions.com>
Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
for making VDR use use daemon() instead of fork() to run in daemon mode
+ for fixing a possible endless loop in a menu with no selectable items if
+ Setup.MenuScrollWrap
+ is true (thanks to Enrico Scholz).
diff --git a/HISTORY b/HISTORY
index 25bc5243..d82e4b9f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3889,4 +3889,7 @@ Video Disk Recorder Revision History
2005-10-09: Version 1.3.35
- Updated 'sources.conf' (thanks to Philip Prindeville).
-- Now using daemon() instead of fork() to run VDR in daemon mode (thanks to Enrico Scholz).
+- Now using daemon() instead of fork() to run VDR in daemon mode (thanks to
+ Enrico Scholz).
+- Fixed a possible endless loop in a menu with no selectable items if
+ Setup.MenuScrollWrap is true (thanks to Enrico Scholz).
diff --git a/osdbase.c b/osdbase.c
index 9646bcc4..fca68662 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.22 2005/10/02 15:00:40 kls Exp $
+ * $Id: osdbase.c 1.23 2005/10/09 10:42:35 kls Exp $
*/
#include "osdbase.h"
@@ -268,14 +268,16 @@ void cOsdMenu::CursorUp(void)
int tmpCurrent = current;
int lastOnScreen = first + displayMenuItems - 1;
int last = Count() - 1;
+ if (last < 0)
+ return;
while (--tmpCurrent != current) {
if (tmpCurrent < 0) {
if (Setup.MenuScrollWrap)
- tmpCurrent = last;
+ tmpCurrent = last + 1;
else
return;
}
- if (SelectableItem(tmpCurrent))
+ else if (SelectableItem(tmpCurrent))
break;
}
if (first <= tmpCurrent && tmpCurrent <= lastOnScreen)
@@ -298,14 +300,16 @@ void cOsdMenu::CursorDown(void)
int tmpCurrent = current;
int lastOnScreen = first + displayMenuItems - 1;
int last = Count() - 1;
+ if (last < 0)
+ return;
while (++tmpCurrent != current) {
if (tmpCurrent > last) {
if (Setup.MenuScrollWrap)
- tmpCurrent = 0;
+ tmpCurrent = -1;
else
return;
}
- if (SelectableItem(tmpCurrent))
+ else if (SelectableItem(tmpCurrent))
break;
}
if (first <= tmpCurrent && tmpCurrent <= lastOnScreen)