summaryrefslogtreecommitdiff
path: root/user/djvulibre/CVE-2019-18804.patch
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2020-03-03 14:12:43 +0000
committerMax Rees <maxcrees@me.com>2020-03-09 21:27:47 -0500
commit680d3d2f67370934c1aff033819eef438bcb6f94 (patch)
treeb76b2eeec8d7bc1afe3800d2e6164d4f448bff54 /user/djvulibre/CVE-2019-18804.patch
parenta6edd4e40ebb8f25c6b5e8ec444622d22502044d (diff)
downloadpackages-680d3d2f67370934c1aff033819eef438bcb6f94.tar.gz
packages-680d3d2f67370934c1aff033819eef438bcb6f94.tar.bz2
packages-680d3d2f67370934c1aff033819eef438bcb6f94.tar.xz
packages-680d3d2f67370934c1aff033819eef438bcb6f94.zip
user/djvulibre: patch CVE-2019-18804 (#237)
Diffstat (limited to 'user/djvulibre/CVE-2019-18804.patch')
-rw-r--r--user/djvulibre/CVE-2019-18804.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/user/djvulibre/CVE-2019-18804.patch b/user/djvulibre/CVE-2019-18804.patch
new file mode 100644
index 000000000..7c66c3989
--- /dev/null
+++ b/user/djvulibre/CVE-2019-18804.patch
@@ -0,0 +1,39 @@
+From c8bec6549c10ffaa2f2fbad8bbc629efdf0dd125 Mon Sep 17 00:00:00 2001
+From: Leon Bottou <leon@bottou.org>
+Date: Thu, 17 Oct 2019 22:20:31 -0400
+Subject: [PATCH] Fixed bug 309
+
+---
+ libdjvu/IW44EncodeCodec.cpp | 2 +-
+ tools/ddjvu.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libdjvu/IW44EncodeCodec.cpp b/libdjvu/IW44EncodeCodec.cpp
+index 00752a0..f81eaeb 100644
+--- a/libdjvu/IW44EncodeCodec.cpp
++++ b/libdjvu/IW44EncodeCodec.cpp
+@@ -405,7 +405,7 @@ filter_fv(short *p, int w, int h, int rowsize, int scale)
+ int y = 0;
+ int s = scale*rowsize;
+ int s3 = s+s+s;
+- h = ((h-1)/scale)+1;
++ h = (h>0) ? ((h-1)/scale)+1 : 0;
+ y += 1;
+ p += s;
+ while (y-3 < h)
+diff --git a/tools/ddjvu.cpp b/tools/ddjvu.cpp
+index 6d0df3b..7109952 100644
+--- a/tools/ddjvu.cpp
++++ b/tools/ddjvu.cpp
+@@ -279,7 +279,7 @@ render(ddjvu_page_t *page, int pageno)
+ prect.h = (ih * 100) / dpi;
+ }
+ /* Process aspect ratio */
+- if (flag_aspect <= 0)
++ if (flag_aspect <= 0 && iw>0 && ih>0)
+ {
+ double dw = (double)iw / prect.w;
+ double dh = (double)ih / prect.h;
+--
+2.20.1
+