From: Simon Tatham Date: Sun, 31 Dec 2023 13:37:49 +0000 (+0000) Subject: File draw method: add a missing bounds check. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=347418e75aa49014e2d2f4c635eb72646eafd5f9;p=mastodonochrome.git File draw method: add a missing bounds check. Don't try to render an item that doesn't even exist at all. --- diff --git a/src/file.rs b/src/file.rs index 2dcabf6..ae2427d 100644 --- a/src/file.rs +++ b/src/file.rs @@ -354,6 +354,7 @@ impl ActivityState for FeedFile { // Retrieve rendered lines from the bottom of the window upwards 'outer: while item >= self.contents.first_index() && + item < self.contents.index_limit() && lines.len() + 1 < h { let rendered = self.rendered.get(&item)