diff -Nru freeimage-3.18.0+ds2/debian/changelog freeimage-3.18.0+ds2/debian/changelog --- freeimage-3.18.0+ds2/debian/changelog 2020-07-16 17:40:05.000000000 +0000 +++ freeimage-3.18.0+ds2/debian/changelog 2020-08-27 16:25:51.000000000 +0000 @@ -1,3 +1,11 @@ +freeimage (3.18.0+ds2-5+rpi1) bullseye-staging; urgency=medium + + * Apply upstream patch for libraw 0.20 (Closes: 968637) + * Bump build-dependency on libraw-dev as I belive the above patch may + cause breakage with older versions. + + -- Peter Michael Green Thu, 27 Aug 2020 16:25:51 +0000 + freeimage (3.18.0+ds2-5) unstable; urgency=medium * [bef22ed] Revert "Add Rules-Requires-Root: no" diff -Nru freeimage-3.18.0+ds2/debian/control freeimage-3.18.0+ds2/debian/control --- freeimage-3.18.0+ds2/debian/control 2020-07-16 17:40:02.000000000 +0000 +++ freeimage-3.18.0+ds2/debian/control 2020-08-27 16:25:51.000000000 +0000 @@ -11,7 +11,7 @@ libopenexr-dev, libopenjp2-7-dev, libpng-dev, - libraw-dev, + libraw-dev (>= 0.20), libtiff-dev, libwebp-dev, pkg-config, diff -Nru freeimage-3.18.0+ds2/debian/patches/libraw-0.20.patch freeimage-3.18.0+ds2/debian/patches/libraw-0.20.patch --- freeimage-3.18.0+ds2/debian/patches/libraw-0.20.patch 1970-01-01 00:00:00.000000000 +0000 +++ freeimage-3.18.0+ds2/debian/patches/libraw-0.20.patch 2020-08-27 16:25:31.000000000 +0000 @@ -0,0 +1,75 @@ +------------------------------------------------------------------------ +r1842 | drolon | 2020-06-01 02:38:25 +0000 (Mon, 01 Jun 2020) | 1 line + +FreeImage now uses LibRaw 0.20-Beta2 (GIT patch 2020-05-29) +------------------------------------------------------------------------ +Index: Source/FreeImage/PluginRAW.cpp +=================================================================== +--- a/Source/FreeImage/PluginRAW.cpp (revision 1841) ++++ b/Source/FreeImage/PluginRAW.cpp (revision 1842) +@@ -59,21 +59,18 @@ + } + + 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 @@ + + 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 @@ + 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 @@ + } + + int eof() { +- if(substream) return substream->eof(); + return (_io->tell_proc(_handle) >= _eof); + } + diff -Nru freeimage-3.18.0+ds2/debian/patches/series freeimage-3.18.0+ds2/debian/patches/series --- freeimage-3.18.0+ds2/debian/patches/series 2020-07-15 19:40:13.000000000 +0000 +++ freeimage-3.18.0+ds2/debian/patches/series 2020-08-27 16:24:17.000000000 +0000 @@ -9,3 +9,4 @@ Enable-substitution-of-pkg-config.patch CVE-2019-12211-13.patch Fix_compilation_external-static.patch +libraw-0.20.patch