public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/djvu/, app-text/djvu/files/
@ 2019-11-11 20:07 Mikle Kolyada
  0 siblings, 0 replies; 2+ messages in thread
From: Mikle Kolyada @ 2019-11-11 20:07 UTC (permalink / raw
  To: gentoo-commits

commit:     00faf7222c973e9d4d48256a492f5853ac97b147
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 19:57:51 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 20:07:08 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00faf722

app-text/djvu: fix CVE-2019-18804

Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 app-text/djvu/djvu-3.5.27-r1.ebuild          | 66 ++++++++++++++++++++++++++++
 app-text/djvu/files/fix-CVE-2019-18804.patch | 39 ++++++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/app-text/djvu/djvu-3.5.27-r1.ebuild b/app-text/djvu/djvu-3.5.27-r1.ebuild
new file mode 100644
index 00000000000..0701849a730
--- /dev/null
+++ b/app-text/djvu/djvu-3.5.27-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop flag-o-matic xdg-utils
+
+MY_P="${PN}libre-${PV#*_p}"
+
+DESCRIPTION="DjVu viewers, encoders and utilities"
+HOMEPAGE="http://djvu.sourceforge.net/"
+SRC_URI="http://downloads.sourceforge.net/djvu/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
+IUSE="debug doc jpeg tiff xml"
+
+PATCHES=( "${FILESDIR}"/fix-CVE-2019-18804.patch )
+
+RDEPEND="jpeg? ( virtual/jpeg:0 )
+	tiff? ( media-libs/tiff:0= )"
+DEPEND="${RDEPEND}
+	|| ( gnome-base/librsvg media-gfx/inkscape )"
+
+S=${WORKDIR}/${MY_P%%.3}
+
+src_configure() {
+	use debug && append-cppflags "-DRUNTIME_DEBUG_ONLY"
+
+	# We install all desktop files by hand.
+	econf \
+		$(use_enable xml xmltools) \
+		$(use_with jpeg) \
+		$(use_with tiff) \
+		--disable-desktopfiles
+}
+
+DOCS=( NEWS README )
+
+src_install() {
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+
+	use doc && dodoc -r doc
+
+	# Install desktop files.
+	cd desktopfiles
+	for i in {22,32,48,64}; do
+		insinto /usr/share/icons/hicolor/${i}x${i}/mimetypes
+		newins prebuilt-hi${i}-djvu.png image-vnd.djvu.png
+	done
+	insinto /usr/share/mime/packages
+	doins djvulibre-mime.xml
+}
+
+pkg_postinst() {
+	xdg_mimeinfo_database_update
+	has_version app-text/djview || \
+		optfeature "For djviewer or browser plugin" app-text/djview
+}
+
+pkg_postrm() {
+	xdg_mimeinfo_database_update
+}

diff --git a/app-text/djvu/files/fix-CVE-2019-18804.patch b/app-text/djvu/files/fix-CVE-2019-18804.patch
new file mode 100644
index 00000000000..b5d790ba1b1
--- /dev/null
+++ b/app-text/djvu/files/fix-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.23.0
+


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/djvu/, app-text/djvu/files/
@ 2023-08-19  5:50 Joonas Niilola
  0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2023-08-19  5:50 UTC (permalink / raw
  To: gentoo-commits

commit:     1c370b3aebafad706edbb6aecbad93f5ad0eebb6
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Thu Aug 17 18:09:22 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 05:50:45 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c370b3a

app-text/djvu: Fix C++17 does not allow register storage class

Closes: https://bugs.gentoo.org/894644
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32359
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-text/djvu/djvu-3.5.28-r4.ebuild                | 71 ++++++++++++++++++++++
 ...djvu-3.5.28-drop-register-keyword-clang16.patch | 21 +++++++
 2 files changed, 92 insertions(+)

diff --git a/app-text/djvu/djvu-3.5.28-r4.ebuild b/app-text/djvu/djvu-3.5.28-r4.ebuild
new file mode 100644
index 000000000000..8ca0e11bdbb9
--- /dev/null
+++ b/app-text/djvu/djvu-3.5.28-r4.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic optfeature xdg
+
+MY_P="${PN}libre-${PV#*_p}"
+DESCRIPTION="DjVu viewers, encoders and utilities"
+HOMEPAGE="https://djvu.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/djvu/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P%%.3}"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="debug doc jpeg tiff xml"
+
+RDEPEND="jpeg? ( media-libs/libjpeg-turbo:= )
+	tiff? ( media-libs/tiff:= )"
+DEPEND="${RDEPEND}"
+
+# inkscape/rsvg-convert are used to generate icons at build-time only
+BDEPEND="app-arch/unzip
+	|| ( gnome-base/librsvg media-gfx/inkscape )"
+
+DOCS=( NEWS README )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.5.28-drop-register-keyword-clang16.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	use debug && append-cppflags "-DRUNTIME_DEBUG_ONLY"
+
+	# We install all desktop files by hand.
+	econf \
+		$(use_enable xml xmltools) \
+		$(use_with jpeg) \
+		$(use_with tiff) \
+		--disable-desktopfiles
+}
+
+src_install() {
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+
+	use doc && dodoc -r doc
+
+	# Install desktop files.
+	cd desktopfiles || die
+	for i in {22,32,48,64}; do
+		insinto /usr/share/icons/hicolor/${i}x${i}/mimetypes
+		newins prebuilt-hi${i}-djvu.png image-vnd.djvu.png
+	done
+
+	insinto /usr/share/mime/packages
+	doins djvulibre-mime.xml
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+
+	optfeature "djviewer or browser plugin" app-text/djview
+}

diff --git a/app-text/djvu/files/djvu-3.5.28-drop-register-keyword-clang16.patch b/app-text/djvu/files/djvu-3.5.28-drop-register-keyword-clang16.patch
new file mode 100644
index 000000000000..dd86bb8bf130
--- /dev/null
+++ b/app-text/djvu/files/djvu-3.5.28-drop-register-keyword-clang16.patch
@@ -0,0 +1,21 @@
+Bug: https://bugs.gentoo.org/894644
+--- a/libdjvu/GBitmap.h
++++ b/libdjvu/GBitmap.h
+@@ -620,7 +620,7 @@ GBitmap::euclidian_ratio(int a, int b, int &q, int &r)
+ inline int
+ GBitmap::read_run(unsigned char *&data)
+ {
+-  register int z=*data++;
++  int z=*data++;
+   return (z>=RUNOVERFLOWVALUE)?
+     ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
+ }
+@@ -628,7 +628,7 @@ GBitmap::read_run(unsigned char *&data)
+ inline int
+ GBitmap::read_run(const unsigned char *&data)
+ {
+-  register int z=*data++;
++  int z=*data++;
+   return (z>=RUNOVERFLOWVALUE)?
+     ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
+ }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-19  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-11 20:07 [gentoo-commits] repo/gentoo:master commit in: app-text/djvu/, app-text/djvu/files/ Mikle Kolyada
  -- strict thread matches above, loose matches on Subject: below --
2023-08-19  5:50 Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox