chiark
/
gitweb
/
~ian
/
mastodonochrome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c3607b
)
File draw method: add a missing bounds check.
author
Simon Tatham
<anakin@pobox.com>
Sun, 31 Dec 2023 13:37:49 +0000
(13:37 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Sun, 31 Dec 2023 13:37:49 +0000
(13:37 +0000)
Don't try to render an item that doesn't even exist at all.
src/file.rs
patch
|
blob
|
history
diff --git
a/src/file.rs
b/src/file.rs
index 2dcabf66fec9fb22a7f1a2853dbd0e42ec3598e8..ae2427d9507e5073e6f7569883b76205cf8f894f 100644
(file)
--- a/
src/file.rs
+++ b/
src/file.rs
@@
-354,6
+354,7
@@
impl<Type: FeedType> ActivityState for FeedFile<Type> {
// 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)