summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Pyeatt <larry.pyeatt@sdsmt.edu>2020-12-28 15:24:36 -0700
committerSam James <sam@gentoo.org>2020-12-29 01:02:34 +0000
commit4e04aa9c3a2fc91635da5023090ba023a1e4932f (patch)
treef577558d65b6962c93544686eec3c02c49f91c97 /media-libs/freeimage
parentmedia-video/gpac: add zlib dep (diff)
downloadgentoo-4e04aa9c3a2fc91635da5023090ba023a1e4932f.tar.gz
gentoo-4e04aa9c3a2fc91635da5023090ba023a1e4932f.tar.bz2
gentoo-4e04aa9c3a2fc91635da5023090ba023a1e4932f.zip
media-libs/freeimage: fix build with >=media-libs/libraw-0.20.0
Signed-off-by: Larry Pyeatt <larry.pyeatt@sdsmt.edu> Closes: https://bugs.gentoo.org/734724 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/freeimage')
-rw-r--r--media-libs/freeimage/files/freeimage-3.18.0-libraw-0.20.0.patch70
-rw-r--r--media-libs/freeimage/freeimage-3.18.0-r2.ebuild1
2 files changed, 71 insertions, 0 deletions
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-libraw-0.20.0.patch b/media-libs/freeimage/files/freeimage-3.18.0-libraw-0.20.0.patch
new file mode 100644
index 000000000000..6b15a99838c6
--- /dev/null
+++ b/media-libs/freeimage/files/freeimage-3.18.0-libraw-0.20.0.patch
@@ -0,0 +1,70 @@
+diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp
+index b3f2a8db..ab0499ff 100644
+--- a/Source/FreeImage/PluginRAW.cpp
++++ b/Source/FreeImage/PluginRAW.cpp
+@@ -59,21 +59,18 @@ public:
+ }
+
+ int valid() {
+- return (_io && _handle);
++ return (_io && _handle) ? 1 : 0;
+ }
+
+ int read(void *buffer, size_t size, size_t count) {
+- if(substream) return substream->read(buffer, size, count);
+ return _io->read_proc(buffer, (unsigned)size, (unsigned)count, _handle);
+ }
+
+ int seek(INT64 offset, int origin) {
+- if(substream) return substream->seek(offset, origin);
+ return _io->seek_proc(_handle, (long)offset, origin);
+ }
+
+ INT64 tell() {
+- if(substream) return substream->tell();
+ return _io->tell_proc(_handle);
+ }
+
+@@ -83,19 +80,21 @@ public:
+
+ int get_char() {
+ int c = 0;
+- if(substream) return substream->get_char();
+- if(!_io->read_proc(&c, 1, 1, _handle)) return -1;
++ if (!_io->read_proc(&c, 1, 1, _handle)) {
++ return -1;
++ }
+ return c;
+ }
+
+ char* gets(char *buffer, int length) {
+- if (substream) return substream->gets(buffer, length);
+ memset(buffer, 0, length);
+ for(int i = 0; i < length; i++) {
+- if(!_io->read_proc(&buffer[i], 1, 1, _handle))
++ if (!_io->read_proc(&buffer[i], 1, 1, _handle)) {
+ return NULL;
+- if(buffer[i] == 0x0A)
++ }
++ if (buffer[i] == 0x0A) {
+ break;
++ }
+ }
+ return buffer;
+ }
+@@ -104,7 +103,6 @@ public:
+ std::string buffer;
+ char element = 0;
+ bool bDone = false;
+- if(substream) return substream->scanf_one(fmt,val);
+ do {
+ if(_io->read_proc(&element, 1, 1, _handle) == 1) {
+ switch(element) {
+@@ -127,7 +125,6 @@ public:
+ }
+
+ int eof() {
+- if(substream) return substream->eof();
+ return (_io->tell_proc(_handle) >= _eof);
+ }
+
diff --git a/media-libs/freeimage/freeimage-3.18.0-r2.ebuild b/media-libs/freeimage/freeimage-3.18.0-r2.ebuild
index d8b629ca9c1f..e833f947fde1 100644
--- a/media-libs/freeimage/freeimage-3.18.0-r2.ebuild
+++ b/media-libs/freeimage/freeimage-3.18.0-r2.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-3.18.0-raw.patch
"${FILESDIR}"/${PN}-3.18.0-libjpeg9.patch
"${FILESDIR}"/${PN}-3.18.0-CVE-2019-12211-CVE-2019-12213.patch
+ "${FILESDIR}"/${PN}-3.18.0-libraw-0.20.0.patch
)
src_prepare() {