···11+commit c8bec6549c10ffaa2f2fbad8bbc629efdf0dd125
22+Author: Leon Bottou <leon@bottou.org>
33+Date: Thu Oct 17 22:20:31 2019 -0400
44+55+ Fixed bug 309
66+77+diff --git a/libdjvu/IW44EncodeCodec.cpp b/libdjvu/IW44EncodeCodec.cpp
88+index 00752a0..f81eaeb 100644
99+--- a/libdjvu/IW44EncodeCodec.cpp
1010++++ b/libdjvu/IW44EncodeCodec.cpp
1111+@@ -405,7 +405,7 @@ filter_fv(short *p, int w, int h, int rowsize, int scale)
1212+ int y = 0;
1313+ int s = scale*rowsize;
1414+ int s3 = s+s+s;
1515+- h = ((h-1)/scale)+1;
1616++ h = (h>0) ? ((h-1)/scale)+1 : 0;
1717+ y += 1;
1818+ p += s;
1919+ while (y-3 < h)
2020+diff --git a/tools/ddjvu.cpp b/tools/ddjvu.cpp
2121+index 6d0df3b..7109952 100644
2222+--- a/tools/ddjvu.cpp
2323++++ b/tools/ddjvu.cpp
2424+@@ -279,7 +279,7 @@ render(ddjvu_page_t *page, int pageno)
2525+ prect.h = (ih * 100) / dpi;
2626+ }
2727+ /* Process aspect ratio */
2828+- if (flag_aspect <= 0)
2929++ if (flag_aspect <= 0 && iw>0 && ih>0)
3030+ {
3131+ double dw = (double)iw / prect.w;
3232+ double dh = (double)ih / prect.h;
+11
pkgs/applications/misc/djvulibre/default.nix
···2424 libiconv
2525 ];
26262727+ patches = [
2828+ ./CVE-2019-18804.patch
2929+ # This one is needed to make the following
3030+ # two CVE patches apply cleanly
3131+ ./fix_hongfuzz_crash.patch
3232+ ./CVE-2019-15142.patch
3333+ ./CVE-2019-15143.patch
3434+ ./CVE-2019-15144.patch
3535+ ./CVE-2019-15145.patch
3636+ ];
3737+2738 meta = with stdenv.lib; {
2839 description = "The big set of CLI tools to make/modify/optimize/show/export DJVU files";
2940 homepage = "http://djvu.sourceforge.net";