···1+commit c8bec6549c10ffaa2f2fbad8bbc629efdf0dd125
2+Author: Leon Bottou <leon@bottou.org>
3+Date: Thu Oct 17 22:20:31 2019 -0400
4+5+ Fixed bug 309
6+7+diff --git a/libdjvu/IW44EncodeCodec.cpp b/libdjvu/IW44EncodeCodec.cpp
8+index 00752a0..f81eaeb 100644
9+--- a/libdjvu/IW44EncodeCodec.cpp
10++++ b/libdjvu/IW44EncodeCodec.cpp
11+@@ -405,7 +405,7 @@ filter_fv(short *p, int w, int h, int rowsize, int scale)
12+ int y = 0;
13+ int s = scale*rowsize;
14+ int s3 = s+s+s;
15+- h = ((h-1)/scale)+1;
16++ h = (h>0) ? ((h-1)/scale)+1 : 0;
17+ y += 1;
18+ p += s;
19+ while (y-3 < h)
20+diff --git a/tools/ddjvu.cpp b/tools/ddjvu.cpp
21+index 6d0df3b..7109952 100644
22+--- a/tools/ddjvu.cpp
23++++ b/tools/ddjvu.cpp
24+@@ -279,7 +279,7 @@ render(ddjvu_page_t *page, int pageno)
25+ prect.h = (ih * 100) / dpi;
26+ }
27+ /* Process aspect ratio */
28+- if (flag_aspect <= 0)
29++ if (flag_aspect <= 0 && iw>0 && ih>0)
30+ {
31+ double dw = (double)iw / prect.w;
32+ double dh = (double)ih / prect.h;
+11
pkgs/applications/misc/djvulibre/default.nix
···24 libiconv
25 ];
260000000000027 meta = with stdenv.lib; {
28 description = "The big set of CLI tools to make/modify/optimize/show/export DJVU files";
29 homepage = "http://djvu.sourceforge.net";
···24 libiconv
25 ];
2627+ patches = [
28+ ./CVE-2019-18804.patch
29+ # This one is needed to make the following
30+ # two CVE patches apply cleanly
31+ ./fix_hongfuzz_crash.patch
32+ ./CVE-2019-15142.patch
33+ ./CVE-2019-15143.patch
34+ ./CVE-2019-15144.patch
35+ ./CVE-2019-15145.patch
36+ ];
37+38 meta = with stdenv.lib; {
39 description = "The big set of CLI tools to make/modify/optimize/show/export DJVU files";
40 homepage = "http://djvu.sourceforge.net";