From bf698e2497e2e3f81d84e40389fd681679467cc45a629ca93886e982074153b1 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 1 Aug 2018 10:16:21 +0000 Subject: [PATCH 1/5] - new upstream branch, version 0.19.x * fixes CVE-2018-10529 and CVE-2018-10528, hence removing . libraw-CVE-2018-10528.patch . libraw-CVE-2018-10529.patch * the rest of changes at https://www.libraw.org/download#stable OBS-URL: https://build.opensuse.org/package/show/graphics/libraw?expand=0&rev=115 --- LibRaw-0.18.9.tar.gz | 3 -- LibRaw-0.19.0.tar.gz | 3 ++ libraw-CVE-2018-10528.patch | 37 ----------------- libraw-CVE-2018-10529.patch | 79 ------------------------------------- libraw.changes | 10 +++++ libraw.spec | 8 +--- 6 files changed, 15 insertions(+), 125 deletions(-) delete mode 100644 LibRaw-0.18.9.tar.gz create mode 100644 LibRaw-0.19.0.tar.gz delete mode 100644 libraw-CVE-2018-10528.patch delete mode 100644 libraw-CVE-2018-10529.patch diff --git a/LibRaw-0.18.9.tar.gz b/LibRaw-0.18.9.tar.gz deleted file mode 100644 index 79e3b8e..0000000 --- a/LibRaw-0.18.9.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2ef177032e6d804fc512b206d02c393fca26be43ecd136cc26926407273b24e -size 1282015 diff --git a/LibRaw-0.19.0.tar.gz b/LibRaw-0.19.0.tar.gz new file mode 100644 index 0000000..4216777 --- /dev/null +++ b/LibRaw-0.19.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e83f51e83b19f9ba6b8bd144475fc12edf2d7b3b930d8d280bdebd8a8f3ed259 +size 1300662 diff --git a/libraw-CVE-2018-10528.patch b/libraw-CVE-2018-10528.patch deleted file mode 100644 index 38bd8aa..0000000 --- a/libraw-CVE-2018-10528.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: LibRaw-0.18.9/src/libraw_cxx.cpp -=================================================================== ---- LibRaw-0.18.9.orig/src/libraw_cxx.cpp 2018-04-30 11:13:15.126021499 +0200 -+++ LibRaw-0.18.9/src/libraw_cxx.cpp 2018-04-30 11:16:43.677077398 +0200 -@@ -5484,17 +5484,18 @@ void x3f_clear(void *p) - x3f_delete((x3f_t*)p); - } - --static char *utf2char(utf16_t *str, char *buffer) -+void utf2char(utf16_t *str, char *buffer, unsigned bufsz) - { -+ if(bufsz<1) return; -+ buffer[bufsz-1] = 0; - char *b = buffer; - -- while (*str != 0x00) { -+ while (*str != 0x00 && --bufsz>0) { - char *chr = (char *)str; - *b++ = *chr; - str++; - } - *b = 0; -- return buffer; - } - - static void *lr_memmem(const void *l, size_t l_len, const void *s, size_t s_len) -@@ -5555,8 +5556,8 @@ void LibRaw::parse_x3f() - x3f_property_t *P = PL->property_table.element; - for (i=0; inum_properties; i++) { - char name[100], value[100]; -- utf2char(P[i].name,name); -- utf2char(P[i].value,value); -+ utf2char(P[i].name,name,sizeof(name)); -+ utf2char(P[i].value,value,sizeof(value)); - if (!strcmp (name, "ISO")) - imgdata.other.iso_speed = atoi(value); - if (!strcmp (name, "CAMMANUF")) diff --git a/libraw-CVE-2018-10529.patch b/libraw-CVE-2018-10529.patch deleted file mode 100644 index 4648adf..0000000 --- a/libraw-CVE-2018-10529.patch +++ /dev/null @@ -1,79 +0,0 @@ -Index: LibRaw-0.18.9/internal/libraw_x3f.cpp -=================================================================== ---- LibRaw-0.18.9.orig/internal/libraw_x3f.cpp 2018-04-24 16:23:24.000000000 +0200 -+++ LibRaw-0.18.9/internal/libraw_x3f.cpp 2018-04-30 11:35:17.477351409 +0200 -@@ -121,8 +121,6 @@ typedef struct x3f_property_s { - /* Computed */ - utf16_t *name; /* 0x0000 terminated UTF 16 */ - utf16_t *value; /* 0x0000 terminated UTF 16 */ -- char *name_utf8; /* converted to UTF 8 */ -- char *value_utf8; /* converted to UTF 8 */ - } x3f_property_t; - - typedef struct x3f_property_table_s { -@@ -516,7 +514,6 @@ unsigned x3f_get4(LibRaw_abstract_datast - int _cur = _file->_func(_buffer,1,_left); \ - if (_cur == 0) { \ - throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -- exit(1); \ - } \ - _left -= _cur; \ - } \ -@@ -912,11 +909,6 @@ static void free_camf_entry(camf_entry_t - if (PL) - { - int i; -- -- for (i = 0; i < PL->property_table.size; i++) { -- FREE(PL->property_table.element[i].name_utf8); -- FREE(PL->property_table.element[i].value_utf8); -- } - } - FREE(PL->property_table.element); - FREE(PL->data); -@@ -1624,14 +1616,14 @@ static void x3f_load_property_list(x3f_i - - if (!PL->data_size) - PL->data_size = read_data_block(&PL->data, I, DE, 0); -+ uint32_t maxoffset = PL->data_size/sizeof(utf16_t)-2; // at least 2 chars, value + terminating 0x0000 - - for (i=0; inum_properties; i++) { - x3f_property_t *P = &PL->property_table.element[i]; -- -+ if(P->name_offset > maxoffset || P->value_offset > maxoffset) -+ throw LIBRAW_EXCEPTION_IO_CORRUPT; - P->name = ((utf16_t *)PL->data + P->name_offset); - P->value = ((utf16_t *)PL->data + P->value_offset); -- P->name_utf8 = 0;// utf16le_to_utf8(P->name); -- P->value_utf8 = 0;//utf16le_to_utf8(P->value); - } - } - -Index: LibRaw-0.18.9/src/libraw_cxx.cpp -=================================================================== ---- LibRaw-0.18.9.orig/src/libraw_cxx.cpp 2018-04-30 11:35:17.477351409 +0200 -+++ LibRaw-0.18.9/src/libraw_cxx.cpp 2018-04-30 11:38:21.568048079 +0200 -@@ -5551,13 +5551,21 @@ void LibRaw::parse_x3f() - // Parse property list - DEH = &DE->header; - x3f_property_list_t *PL = &DEH->data_subsection.property_list; -+ utf16_t *datap = (utf16_t*) PL->data; -+ uint32_t maxitems = PL->data_size/sizeof(utf16_t); - if (PL->property_table.size != 0) { - int i; - x3f_property_t *P = PL->property_table.element; - for (i=0; inum_properties; i++) { - char name[100], value[100]; -- utf2char(P[i].name,name,sizeof(name)); -- utf2char(P[i].value,value,sizeof(value)); -+ int noffset = (P[i].name - datap); -+ int voffset = (P[i].value - datap); -+ if(noffset < 0 || noffset>maxitems || voffset<0 || voffset>maxitems) -+ throw LIBRAW_EXCEPTION_IO_CORRUPT; -+ int maxnsize = maxitems - (P[i].name - datap); -+ int maxvsize = maxitems - (P[i].value - datap); -+ utf2char(P[i].name, name,MIN(maxnsize,sizeof(name))); -+ utf2char(P[i].value, value,MIN(maxvsize,sizeof(value))); - if (!strcmp (name, "ISO")) - imgdata.other.iso_speed = atoi(value); - if (!strcmp (name, "CAMMANUF")) diff --git a/libraw.changes b/libraw.changes index a42e896..433b1fa 100644 --- a/libraw.changes +++ b/libraw.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Aug 1 10:13:46 UTC 2018 - pgajdos@suse.com + +- new upstream branch, version 0.19.x + * fixes CVE-2018-10529 and CVE-2018-10528, hence removing + . libraw-CVE-2018-10528.patch + . libraw-CVE-2018-10529.patch + * the rest of changes at + https://www.libraw.org/download#stable + ------------------------------------------------------------------- Mon Apr 30 09:18:00 UTC 2018 - pgajdos@suse.com diff --git a/libraw.spec b/libraw.spec index bd1a827..2448db1 100644 --- a/libraw.spec +++ b/libraw.spec @@ -17,10 +17,10 @@ %define tar_name LibRaw -%define lver 16 +%define lver 19 %define lname libraw%{lver} Name: libraw -Version: 0.18.9 +Version: 0.19.0 Release: 0 Summary: Library for reading RAW files obtained from digital photo cameras License: CDDL-1.0 OR LGPL-2.1-only @@ -28,8 +28,6 @@ Group: Development/Libraries/C and C++ Url: https://www.libraw.org/ #Git-Clone: git://github.com/LibRaw/LibRaw Source: https://www.libraw.org/data/%tar_name-%version.tar.gz -Patch0: libraw-CVE-2018-10528.patch -Patch1: libraw-CVE-2018-10529.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libjasper-devel @@ -97,8 +95,6 @@ against LibRaw. LibRaw does not provide dynamic libraries. %prep %setup -qn %tar_name-%version -%patch0 -p1 -%patch1 -p1 %build export CXXFLAGS="%optflags -fPIC -DUSE_ZLIB" From 002f02bcd42cb665daad75cd439129c474d751645ee6e06e3215f181082c13fb Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 1 Aug 2018 11:19:18 +0000 Subject: [PATCH 2/5] - security update * CVE-2018-5813 [bsc#1103200] + libraw-CVE-2018-5813.patch OBS-URL: https://build.opensuse.org/package/show/graphics/libraw?expand=0&rev=116 --- libraw-CVE-2018-5813.patch | 81 ++++++++++++++++++++++++++++++++++++++ libraw.changes | 7 ++++ libraw.spec | 2 + 3 files changed, 90 insertions(+) create mode 100644 libraw-CVE-2018-5813.patch diff --git a/libraw-CVE-2018-5813.patch b/libraw-CVE-2018-5813.patch new file mode 100644 index 0000000..fbc7a5f --- /dev/null +++ b/libraw-CVE-2018-5813.patch @@ -0,0 +1,81 @@ +Index: LibRaw-0.19.0/dcraw/dcraw.c +=================================================================== +--- LibRaw-0.19.0.orig/dcraw/dcraw.c 2018-08-01 12:52:18.284642412 +0200 ++++ LibRaw-0.19.0/dcraw/dcraw.c 2018-08-01 13:14:20.831394866 +0200 +@@ -6364,17 +6364,33 @@ void CLASS apply_tiff() + + void CLASS parse_minolta (int base) + { +- int save, tag, len, offset, high=0, wide=0, i, c; ++ int tag, len, offset, high=0, wide=0, i, c; + short sorder=order; ++#ifdef LIBRAW_LIBRARY_BUILD ++ INT64 save; ++#else ++ int save; ++#endif + + fseek (ifp, base, SEEK_SET); + if (fgetc(ifp) || fgetc(ifp)-'M' || fgetc(ifp)-'R') return; + order = fgetc(ifp) * 0x101; + offset = base + get4() + 8; ++#ifdef LIBRAW_LIBRARY_BUILD ++ INT64 fsize = ifp->size(); ++ if(offset>fsize-8) // At least 8 bytes for tag/len ++ offset = fsize-8; ++#endif + while ((save=ftell(ifp)) < offset) { + for (tag=i=0; i < 4; i++) + tag = tag << 8 | fgetc(ifp); + len = get4(); ++ if(len < 0) ++ return; // just ignore wrong len?? or raise bad file exception? ++#ifdef LIBRAW_LIBRARY_BUILD ++ if((INT64)len + save + 8ULL > save) ++ return; // just ignore out of file metadata, stop parse ++#endif + switch (tag) { + case 0x505244: /* PRD */ + fseek (ifp, 8, SEEK_CUR); +Index: LibRaw-0.19.0/internal/dcraw_common.cpp +=================================================================== +--- LibRaw-0.19.0.orig/internal/dcraw_common.cpp 2018-08-01 12:52:18.288642432 +0200 ++++ LibRaw-0.19.0/internal/dcraw_common.cpp 2018-08-01 13:13:55.263263676 +0200 +@@ -14413,8 +14413,13 @@ void CLASS apply_tiff() + + void CLASS parse_minolta(int base) + { +- int save, tag, len, offset, high = 0, wide = 0, i, c; ++ int tag, len, offset, high = 0, wide = 0, i, c; + short sorder = order; ++#ifdef LIBRAW_LIBRARY_BUILD ++ INT64 save; ++#else ++ int save; ++#endif + + fseek(ifp, base, SEEK_SET); + if (fgetc(ifp) || fgetc(ifp) - 'M' || fgetc(ifp) - 'R') +@@ -14422,8 +14427,9 @@ void CLASS parse_minolta(int base) + order = fgetc(ifp) * 0x101; + offset = base + get4() + 8; + #ifdef LIBRAW_LIBRARY_BUILD +- if(offset>ifp->size()-8) // At least 8 bytes for tag/len +- offset = ifp->size()-8; ++ INT64 fsize = ifp->size(); ++ if(offset>fsize-8) // At least 8 bytes for tag/len ++ offset = fsize-8; + #endif + + while ((save = ftell(ifp)) < offset) +@@ -14433,6 +14439,10 @@ void CLASS parse_minolta(int base) + len = get4(); + if(len < 0) + return; // just ignore wrong len?? or raise bad file exception? ++#ifdef LIBRAW_LIBRARY_BUILD ++ if((INT64)len + save + 8ULL > save) ++ return; // just ignore out of file metadata, stop parse ++#endif + switch (tag) + { + case 0x505244: /* PRD */ diff --git a/libraw.changes b/libraw.changes index 433b1fa..46b7201 100644 --- a/libraw.changes +++ b/libraw.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 1 11:07:43 UTC 2018 - pgajdos@suse.com + +- security update + * CVE-2018-5813 [bsc#1103200] + + libraw-CVE-2018-5813.patch + ------------------------------------------------------------------- Wed Aug 1 10:13:46 UTC 2018 - pgajdos@suse.com diff --git a/libraw.spec b/libraw.spec index 2448db1..7863d50 100644 --- a/libraw.spec +++ b/libraw.spec @@ -28,6 +28,7 @@ Group: Development/Libraries/C and C++ Url: https://www.libraw.org/ #Git-Clone: git://github.com/LibRaw/LibRaw Source: https://www.libraw.org/data/%tar_name-%version.tar.gz +Patch0: libraw-CVE-2018-5813.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libjasper-devel @@ -95,6 +96,7 @@ against LibRaw. LibRaw does not provide dynamic libraries. %prep %setup -qn %tar_name-%version +%patch0 -p1 %build export CXXFLAGS="%optflags -fPIC -DUSE_ZLIB" From 129f943f5f210f92ff2d8b0a3ccfa783651d4e3588789c9811418b3a800b8afd Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 1 Aug 2018 11:43:03 +0000 Subject: [PATCH 3/5] * CVE-2018-5815 [bsc#1103206] + libraw-CVE-2018-5815.patch OBS-URL: https://build.opensuse.org/package/show/graphics/libraw?expand=0&rev=117 --- libraw-CVE-2018-5815.patch | 13 +++++++++++++ libraw.changes | 2 ++ libraw.spec | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 libraw-CVE-2018-5815.patch diff --git a/libraw-CVE-2018-5815.patch b/libraw-CVE-2018-5815.patch new file mode 100644 index 0000000..bd83215 --- /dev/null +++ b/libraw-CVE-2018-5815.patch @@ -0,0 +1,13 @@ +Index: LibRaw-0.19.0/dcraw/dcraw.c +=================================================================== +--- LibRaw-0.19.0.orig/dcraw/dcraw.c 2018-08-01 13:33:31.125280841 +0200 ++++ LibRaw-0.19.0/dcraw/dcraw.c 2018-08-01 13:34:22.757544606 +0200 +@@ -6915,6 +6915,8 @@ void CLASS parse_qt (int end) + while (ftell(ifp)+7 < end) { + save = ftell(ifp); + if ((size = get4()) < 8) return; ++ if ((int)size < 0) return; // 2+GB is too much ++ if (save + size < save) return; // 32bit overflow + fread (tag, 4, 1, ifp); + if (!memcmp(tag,"moov",4) || + !memcmp(tag,"udta",4) || diff --git a/libraw.changes b/libraw.changes index 46b7201..ea475f5 100644 --- a/libraw.changes +++ b/libraw.changes @@ -4,6 +4,8 @@ Wed Aug 1 11:07:43 UTC 2018 - pgajdos@suse.com - security update * CVE-2018-5813 [bsc#1103200] + libraw-CVE-2018-5813.patch + * CVE-2018-5815 [bsc#1103206] + + libraw-CVE-2018-5815.patch ------------------------------------------------------------------- Wed Aug 1 10:13:46 UTC 2018 - pgajdos@suse.com diff --git a/libraw.spec b/libraw.spec index 7863d50..896030b 100644 --- a/libraw.spec +++ b/libraw.spec @@ -29,6 +29,7 @@ Url: https://www.libraw.org/ #Git-Clone: git://github.com/LibRaw/LibRaw Source: https://www.libraw.org/data/%tar_name-%version.tar.gz Patch0: libraw-CVE-2018-5813.patch +Patch1: libraw-CVE-2018-5815.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libjasper-devel @@ -97,6 +98,7 @@ against LibRaw. LibRaw does not provide dynamic libraries. %prep %setup -qn %tar_name-%version %patch0 -p1 +%patch1 -p1 %build export CXXFLAGS="%optflags -fPIC -DUSE_ZLIB" From dbea602fbbed39bf8826e3c22d2d904e121fb207d908cc280ea580bd9d321578 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 1 Aug 2018 12:20:41 +0000 Subject: [PATCH 4/5] OBS-URL: https://build.opensuse.org/package/show/graphics/libraw?expand=0&rev=118 --- libraw-CVE-2018-5813.patch | 39 -------------------------------------- libraw-CVE-2018-5815.patch | 13 ------------- libraw.changes | 2 -- libraw.spec | 2 -- 4 files changed, 56 deletions(-) delete mode 100644 libraw-CVE-2018-5815.patch diff --git a/libraw-CVE-2018-5813.patch b/libraw-CVE-2018-5813.patch index fbc7a5f..9ed8475 100644 --- a/libraw-CVE-2018-5813.patch +++ b/libraw-CVE-2018-5813.patch @@ -1,42 +1,3 @@ -Index: LibRaw-0.19.0/dcraw/dcraw.c -=================================================================== ---- LibRaw-0.19.0.orig/dcraw/dcraw.c 2018-08-01 12:52:18.284642412 +0200 -+++ LibRaw-0.19.0/dcraw/dcraw.c 2018-08-01 13:14:20.831394866 +0200 -@@ -6364,17 +6364,33 @@ void CLASS apply_tiff() - - void CLASS parse_minolta (int base) - { -- int save, tag, len, offset, high=0, wide=0, i, c; -+ int tag, len, offset, high=0, wide=0, i, c; - short sorder=order; -+#ifdef LIBRAW_LIBRARY_BUILD -+ INT64 save; -+#else -+ int save; -+#endif - - fseek (ifp, base, SEEK_SET); - if (fgetc(ifp) || fgetc(ifp)-'M' || fgetc(ifp)-'R') return; - order = fgetc(ifp) * 0x101; - offset = base + get4() + 8; -+#ifdef LIBRAW_LIBRARY_BUILD -+ INT64 fsize = ifp->size(); -+ if(offset>fsize-8) // At least 8 bytes for tag/len -+ offset = fsize-8; -+#endif - while ((save=ftell(ifp)) < offset) { - for (tag=i=0; i < 4; i++) - tag = tag << 8 | fgetc(ifp); - len = get4(); -+ if(len < 0) -+ return; // just ignore wrong len?? or raise bad file exception? -+#ifdef LIBRAW_LIBRARY_BUILD -+ if((INT64)len + save + 8ULL > save) -+ return; // just ignore out of file metadata, stop parse -+#endif - switch (tag) { - case 0x505244: /* PRD */ - fseek (ifp, 8, SEEK_CUR); Index: LibRaw-0.19.0/internal/dcraw_common.cpp =================================================================== --- LibRaw-0.19.0.orig/internal/dcraw_common.cpp 2018-08-01 12:52:18.288642432 +0200 diff --git a/libraw-CVE-2018-5815.patch b/libraw-CVE-2018-5815.patch deleted file mode 100644 index bd83215..0000000 --- a/libraw-CVE-2018-5815.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: LibRaw-0.19.0/dcraw/dcraw.c -=================================================================== ---- LibRaw-0.19.0.orig/dcraw/dcraw.c 2018-08-01 13:33:31.125280841 +0200 -+++ LibRaw-0.19.0/dcraw/dcraw.c 2018-08-01 13:34:22.757544606 +0200 -@@ -6915,6 +6915,8 @@ void CLASS parse_qt (int end) - while (ftell(ifp)+7 < end) { - save = ftell(ifp); - if ((size = get4()) < 8) return; -+ if ((int)size < 0) return; // 2+GB is too much -+ if (save + size < save) return; // 32bit overflow - fread (tag, 4, 1, ifp); - if (!memcmp(tag,"moov",4) || - !memcmp(tag,"udta",4) || diff --git a/libraw.changes b/libraw.changes index ea475f5..46b7201 100644 --- a/libraw.changes +++ b/libraw.changes @@ -4,8 +4,6 @@ Wed Aug 1 11:07:43 UTC 2018 - pgajdos@suse.com - security update * CVE-2018-5813 [bsc#1103200] + libraw-CVE-2018-5813.patch - * CVE-2018-5815 [bsc#1103206] - + libraw-CVE-2018-5815.patch ------------------------------------------------------------------- Wed Aug 1 10:13:46 UTC 2018 - pgajdos@suse.com diff --git a/libraw.spec b/libraw.spec index 896030b..7863d50 100644 --- a/libraw.spec +++ b/libraw.spec @@ -29,7 +29,6 @@ Url: https://www.libraw.org/ #Git-Clone: git://github.com/LibRaw/LibRaw Source: https://www.libraw.org/data/%tar_name-%version.tar.gz Patch0: libraw-CVE-2018-5813.patch -Patch1: libraw-CVE-2018-5815.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libjasper-devel @@ -98,7 +97,6 @@ against LibRaw. LibRaw does not provide dynamic libraries. %prep %setup -qn %tar_name-%version %patch0 -p1 -%patch1 -p1 %build export CXXFLAGS="%optflags -fPIC -DUSE_ZLIB" From 61ceba12d237c37bf7f09e5a6828b0cd297840c2857b23826492073719d36921 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 3 Aug 2018 12:14:16 +0000 Subject: [PATCH 5/5] Accepting request 627249 from home:gladiac:branches:graphics - Add patch libraw-Add-Sony-ILCE-7M3.patch * See https://github.com/LibRaw/LibRaw/pull/145 * The patch has been cut, the tarball from the download section doesn't match the git tag. dcraw/dcraw.c is totall different. - Use %license tag OBS-URL: https://build.opensuse.org/request/show/627249 OBS-URL: https://build.opensuse.org/package/show/graphics/libraw?expand=0&rev=119 --- libraw-Add-Sony-ILCE-7M3.patch | 64 ++++++++++++++++++++++++++++++++++ libraw.changes | 9 +++++ libraw.spec | 7 ++-- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 libraw-Add-Sony-ILCE-7M3.patch diff --git a/libraw-Add-Sony-ILCE-7M3.patch b/libraw-Add-Sony-ILCE-7M3.patch new file mode 100644 index 0000000..d9c163d --- /dev/null +++ b/libraw-Add-Sony-ILCE-7M3.patch @@ -0,0 +1,64 @@ +From a340f3d299f73b2ae25678f7b59fc2167d7c6fc1 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 4 May 2018 10:50:10 +0200 +Subject: [PATCH] Add Sony ILCE-7M3 + +Signed-off-by: Andreas Schneider +--- + dcraw/dcraw.c | 11 +++++++---- + internal/dcraw_common.cpp | 11 +++++++---- + 2 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/internal/dcraw_common.cpp b/internal/dcraw_common.cpp +index 0a9afa2..80b91c4 100644 +--- a/internal/dcraw_common.cpp ++++ b/internal/dcraw_common.cpp +@@ -8331,7 +8331,7 @@ void CLASS setSonyBodyFeatures(unsigned id) + {360, LIBRAW_FORMAT_APSC, LIBRAW_MOUNT_Sony_E, LIBRAW_SONY_ILCE, 0, 8, 0x0346, 0x01cd}, + {361, 0, 0, 0, 0, 0, 0xffff, 0xffff}, + {362, LIBRAW_FORMAT_FF, LIBRAW_MOUNT_Sony_E, LIBRAW_SONY_ILCE, 0, 9, 0x0320, 0x019f}, +- {363, 0, 0, 0, 0, 0, 0xffff, 0xffff}, ++ {363, LIBRAW_FORMAT_FF, LIBRAW_MOUNT_Sony_E, LIBRAW_SONY_ILCE, 0, 0, 0x0320, 0x019f}, + {364, LIBRAW_FORMAT_1INCH, LIBRAW_MOUNT_FixedLens, LIBRAW_SONY_DSC, LIBRAW_MOUNT_FixedLens, 8, 0x0346, 0xffff}, + {365, LIBRAW_FORMAT_1INCH, LIBRAW_MOUNT_FixedLens, LIBRAW_SONY_DSC, LIBRAW_MOUNT_FixedLens, 9, 0x0320, 0xffff}, + }; +@@ -8623,7 +8623,7 @@ void CLASS process_Sony_0x9050(uchar *buf, ushort len, unsigned id) + parseSonyLensFeatures(SonySubstitution[buf[0x116]], SonySubstitution[buf[0x117]]); + } + +- if ((id == 347) || (id == 350) || (id == 354) || (id == 357) || (id == 358) || (id == 360) || (id == 362)) ++ if ((id == 347) || (id == 350) || (id == 354) || (id == 357) || (id == 358) || (id == 360) || (id == 362) || (id == 363)) + { + if (len <= 0x8d) + return; +@@ -8687,7 +8687,7 @@ void CLASS process_Sony_0x9400(uchar *buf, ushort len, unsigned id) + if (((bufx == 0x23) || (bufx == 0x24) || (bufx == 0x26)) && (len >= 0x1f)) + { // 0x9400 'c' version + +- if ((id == 358) || (id == 362) || (id == 365)) ++ if ((id == 358) || (id == 362) || (id == 363) || (id == 365)) + { + imgdata.makernotes.sony.ShotNumberSincePowerUp = SonySubstitution[buf[0x0a]]; + } +@@ -17094,6 +17094,8 @@ void CLASS adobe_coeff(const char *t_make, const char *t_model + { 6389,-1703,-378,-4562,12265,2587,-670,1489,6550 } }, + { "Sony ILCE-7M2", 0, 0, + { 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 } }, ++ { "Sony ILCE-7M3", 0, 0, ++ { 7374,-2389,-551,-5435,13162,2519,-1006,1795,6552 } }, + { "Sony ILCE-7SM2", 0, 0, + { 5838,-1430,-246,-3497,11477,2297,-748,1885,5778 } }, + { "Sony ILCE-7S", 0, 0, +@@ -17472,7 +17474,8 @@ void CLASS identify() + {0x155, "DSC-RX100M4"}, {0x156, "DSC-RX10M2"}, {0x158, "DSC-RX1RM2"}, {0x15a, "ILCE-QX1"}, + {0x15b, "ILCE-7RM2"}, {0x15e, "ILCE-7SM2"}, {0x161, "ILCA-68"}, {0x162, "ILCA-99M2"}, + {0x163, "DSC-RX10M3"}, {0x164, "DSC-RX100M5"}, {0x165, "ILCE-6300"}, {0x166, "ILCE-9"}, +- {0x168, "ILCE-6500"}, {0x16a, "ILCE-7RM3"}, {0x16c, "DSC-RX0"}, {0x16d, "DSC-RX10M4"}, ++ {0x168, "ILCE-6500"}, {0x16a, "ILCE-7RM3"}, {0x16b, "ILCE-7M3"}, {0x16c, "DSC-RX0"}, ++ {0x16d, "DSC-RX10M4"}, + }; + + #ifdef LIBRAW_LIBRARY_BUILD +-- +2.16.3 + diff --git a/libraw.changes b/libraw.changes index 46b7201..55efe4a 100644 --- a/libraw.changes +++ b/libraw.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Aug 2 08:33:57 UTC 2018 - asn@cryptomilk.org + +- Add patch libraw-Add-Sony-ILCE-7M3.patch + * See https://github.com/LibRaw/LibRaw/pull/145 + * The patch has been cut, the tarball from the download section + doesn't match the git tag. dcraw/dcraw.c is totall different. +- Use %license tag + ------------------------------------------------------------------- Wed Aug 1 11:07:43 UTC 2018 - pgajdos@suse.com diff --git a/libraw.spec b/libraw.spec index 7863d50..94a8080 100644 --- a/libraw.spec +++ b/libraw.spec @@ -29,6 +29,7 @@ Url: https://www.libraw.org/ #Git-Clone: git://github.com/LibRaw/LibRaw Source: https://www.libraw.org/data/%tar_name-%version.tar.gz Patch0: libraw-CVE-2018-5813.patch +Patch1: libraw-Add-Sony-ILCE-7M3.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libjasper-devel @@ -95,8 +96,9 @@ This package contains static libraries that applications can use to build against LibRaw. LibRaw does not provide dynamic libraries. %prep -%setup -qn %tar_name-%version +%setup -q -n %{tar_name}-%{version} %patch0 -p1 +%patch1 -p1 %build export CXXFLAGS="%optflags -fPIC -DUSE_ZLIB" @@ -124,7 +126,8 @@ rm -rf %buildroot%_datadir/doc %_bindir/* %files devel -%doc Changelog.txt COPYRIGHT LICENSE.CDDL LICENSE.LGPL +%doc Changelog.txt +%license COPYRIGHT LICENSE.CDDL LICENSE.LGPL %doc manual %_includedir/%name/ %_libdir/pkgconfig/*.pc