aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-06 23:29:12 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-06 23:29:12 +0200
commit7477864c92ee980d51049a90271a70ae0c5dfc6b (patch)
treecfa64f1341a5b2496066fc9dcdb3396a0284b5ae
parentfbfa330f9d887e040a575bbd4febe43efb834aa4 (diff)
downloadEpisodeBrowser-7477864c92ee980d51049a90271a70ae0c5dfc6b.tar.gz
Check bounds of episode selection array.
-rw-r--r--c/episodelistview.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c
index 780633c..1113b47 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -183,7 +183,8 @@ ElvUpdate()
lviSelected.mask = LVIF_PARAM;
lviSelected.iItem = -1;
while ((lviSelected.iItem = ListView_GetNextItem(
- HElv, lviSelected.iItem, LVNI_SELECTED)) != -1) {
+ HElv, lviSelected.iItem, LVNI_SELECTED)) != -1
+ && i < 2048) {
if (!ListView_GetItem(HElv, &lviSelected)) continue;
iEpisodeSelected[i++] = lviSelected.lParam;
}