projects
/
mupdf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
962a88a
)
Bug 702899: Fix off-by-one error in accelerate_chapter.
author
Tor Andersson
<
[email protected]
>
Mon, 14 Sep 2020 14:02:31 +0000
(16:02 +0200)
committer
Tor Andersson
<
[email protected]
>
Fri, 18 Sep 2020 09:30:48 +0000
(11:30 +0200)
source/html/epub-doc.c
patch
|
blob
|
blame
|
history
diff --git
a/source/html/epub-doc.c
b/source/html/epub-doc.c
index 2c6d681b852aee5cf0d01fd037f025d6de96cb5f..e14cf47921bf67f371e79eb6df38c9b54cd36825 100644
(file)
--- a/
source/html/epub-doc.c
+++ b/
source/html/epub-doc.c
@@
-323,11
+323,11
@@
accelerate_chapter(fz_context *ctx, epub_document *doc, epub_chapter *ch, fz_htm
if (ch->number >= acc->max_chapters)
{
- int n
= acc->max_chapters * 2
;
+ int n
= acc->max_chapters
;
int i;
if (n == 0)
n = 4;
- while (n < ch->number)
+ while (n <
=
ch->number)
n *= 2;
acc->pages_in_chapter = fz_realloc_array(ctx, acc->pages_in_chapter, n, int);