Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gcc6.git;a=commitdiff;h=fb905d4e8d47c5e5a5675dda7617fd4beccb69be

commit fb905d4e8d47c5e5a5675dda7617fd4beccb69be
Author: crazy <cr...@frugalware.org>
Date:   Sun Sep 18 12:05:24 2016 +0200

libraw-0.17.2-2-x86_64
* fix the build

diff --git a/source/lib/libraw/FrugalBuild b/source/lib/libraw/FrugalBuild
index 9a4031f..ac3633b 100644
--- a/source/lib/libraw/FrugalBuild
+++ b/source/lib/libraw/FrugalBuild
@@ -12,8 +12,11 @@ archs=('i686' 'x86_64')
_F_archive_name="LibRaw"
_F_archive_grepv="Beta"
up2date="Flasttar $url/download"
-source=(http://www.libraw.org/data/$_F_archive_name-${pkgver}.tar.gz)
-sha1sums=('c6721f78bd7437334c33c26354d9f2e072d240e6')
+source=(http://www.libraw.org/data/$_F_archive_name-${pkgver}.tar.gz \
+       dcraw_narrowing.patch LibRaw-0.17.1-CVE-2015-8366-8367.patch)
+sha1sums=('c6721f78bd7437334c33c26354d9f2e072d240e6' \
+          'e11f37cd10c6207f444c820b05e6e2e486da4382' \
+          '0502cef69ba89d4ecbd712ba1446fd1b12d8f5dc')
unset MAKEFLAGS
options+=('force')
_F_cd_path="$_F_archive_name-${pkgver}"
diff --git a/source/lib/libraw/LibRaw-0.17.1-CVE-2015-8366-8367.patch 
b/source/lib/libraw/LibRaw-0.17.1-CVE-2015-8366-8367.patch
new file mode 100644
index 0000000..b8848de
--- /dev/null
+++ b/source/lib/libraw/LibRaw-0.17.1-CVE-2015-8366-8367.patch
@@ -0,0 +1,14 @@
+diff -r -U3 LibRaw-0.17.1.orig/dcraw/dcraw.c LibRaw-0.17.1/dcraw/dcraw.c
+--- LibRaw-0.17.1.orig/dcraw/dcraw.c   2015-05-24 21:30:26.000000000 -0500
++++ LibRaw-0.17.1/dcraw/dcraw.c        2015-12-01 07:47:00.086513959 -0600
+@@ -2901,6 +2901,10 @@
+       diff = diff ? -diff : 0x80;
+     if (ftell(ifp) + 12 >= seg[1][1])
+       diff = 0;
++#ifdef LIBRAW_LIBRARY_BUILD
++    if(pix>=raw_width*raw_height)
++      throw LIBRAW_EXCEPTION_IO_CORRUPT;
++#endif
+     raw_image[pix] = pred[pix & 1] += diff;
+     if (!(pix & 1) && HOLE(pix / raw_width)) pix += 2;
+   }
diff --git a/source/lib/libraw/dcraw_narrowing.patch 
b/source/lib/libraw/dcraw_narrowing.patch
new file mode 100644
index 0000000..c2e2d08
--- /dev/null
+++ b/source/lib/libraw/dcraw_narrowing.patch
@@ -0,0 +1,92 @@
+--- internal/dcraw_common.cpp
++++ internal/dcraw_common.cpp
+@@ -4417,30 +4417,37 @@ void CLASS lin_interpolate()
+  */
+ void CLASS vng_interpolate()
+ {
+-  static const signed char *cp, terms[] = {
+-    -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01,
+-    -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01,
+-    -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03,
+-    -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06,
+-    -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04,
+-    -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01,
+-    -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40,
+-    -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11,
+-    -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11,
+-    -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22,
+-    -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44,
+-    -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10,
+-    -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04,
+-    +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40,
+-    +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20,
+-    +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08,
+-    +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20,
+-    +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44,
+-    +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60,
+-    +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80,
+-    +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40,
+-    +1,+0,+2,+1,0,0x10
+-  }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
++  struct interpolate_terms {
++    signed char y1, x1, y2, x2, weight;
++    unsigned char grads;
++  };
++  static const interpolate_terms terms[] = {
++    {-2,-2,+0,-1,0,0x01}, {-2,-2,+0,+0,1,0x01}, {-2,-1,-1,+0,0,0x01},
++    {-2,-1,+0,-1,0,0x02}, {-2,-1,+0,+0,0,0x03}, {-2,-1,+0,+1,1,0x01},
++    {-2,+0,+0,-1,0,0x06}, {-2,+0,+0,+0,1,0x02}, {-2,+0,+0,+1,0,0x03},
++    {-2,+1,-1,+0,0,0x04}, {-2,+1,+0,-1,1,0x04}, {-2,+1,+0,+0,0,0x06},
++    {-2,+1,+0,+1,0,0x02}, {-2,+2,+0,+0,1,0x04}, {-2,+2,+0,+1,0,0x04},
++    {-1,-2,-1,+0,0,0x80}, {-1,-2,+0,-1,0,0x01}, {-1,-2,+1,-1,0,0x01},
++    {-1,-2,+1,+0,1,0x01}, {-1,-1,-1,+1,0,0x88}, {-1,-1,+1,-2,0,0x40},
++    {-1,-1,+1,-1,0,0x22}, {-1,-1,+1,+0,0,0x33}, {-1,-1,+1,+1,1,0x11},
++    {-1,+0,-1,+2,0,0x08}, {-1,+0,+0,-1,0,0x44}, {-1,+0,+0,+1,0,0x11},
++    {-1,+0,+1,-2,1,0x40}, {-1,+0,+1,-1,0,0x66}, {-1,+0,+1,+0,1,0x22},
++    {-1,+0,+1,+1,0,0x33}, {-1,+0,+1,+2,1,0x10}, {-1,+1,+1,-1,1,0x44},
++    {-1,+1,+1,+0,0,0x66}, {-1,+1,+1,+1,0,0x22}, {-1,+1,+1,+2,0,0x10},
++    {-1,+2,+0,+1,0,0x04}, {-1,+2,+1,+0,1,0x04}, {-1,+2,+1,+1,0,0x04},
++    {+0,-2,+0,+0,1,0x80}, {+0,-1,+0,+1,1,0x88}, {+0,-1,+1,-2,0,0x40},
++    {+0,-1,+1,+0,0,0x11}, {+0,-1,+2,-2,0,0x40}, {+0,-1,+2,-1,0,0x20},
++    {+0,-1,+2,+0,0,0x30}, {+0,-1,+2,+1,1,0x10}, {+0,+0,+0,+2,1,0x08},
++    {+0,+0,+2,-2,1,0x40}, {+0,+0,+2,-1,0,0x60}, {+0,+0,+2,+0,1,0x20},
++    {+0,+0,+2,+1,0,0x30}, {+0,+0,+2,+2,1,0x10}, {+0,+1,+1,+0,0,0x44},
++    {+0,+1,+1,+2,0,0x10}, {+0,+1,+2,-1,1,0x40}, {+0,+1,+2,+0,0,0x60},
++    {+0,+1,+2,+1,0,0x20}, {+0,+1,+2,+2,0,0x10}, {+1,-2,+1,+0,0,0x80},
++    {+1,-1,+1,+1,0,0x88}, {+1,+0,+1,+2,0,0x08}, {+1,+0,+2,-1,0,0x40},
++    {+1,+0,+2,+1,0,0x10}
++  };
++  const interpolate_terms *cpt;
++  signed char *cp;
++  signed char chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 
};
+   ushort (*brow[5])[4], *pix;
+   int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4];
+   int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag;
+@@ -4456,11 +4463,11 @@ void CLASS vng_interpolate()
+   for (row=0; row < prow; row++)              /* Precalculate for VNG */
+     for (col=0; col < pcol; col++) {
+       code[row][col] = ip;
+-      for (cp=terms, t=0; t < 64; t++) {
+-      y1 = *cp++;  x1 = *cp++;
+-      y2 = *cp++;  x2 = *cp++;
+-      weight = *cp++;
+-      grads = *cp++;
++      for (cpt=&terms[0], t=0; t < 64, cpt = &terms[t]; t++) {
++      y1 = cpt->y1;  x1 = cpt->x1;
++      y2 = cpt->y2;  x2 = cpt->x2;
++      weight = cpt->weight;
++      grads = cpt->grads;
+       color = fcol(row+y1,col+x1);
+       if (fcol(row+y2,col+x2) != color) continue;
+       diag = (fcol(row,col+1) == color && fcol(row+1,col) == color) ? 2:1;
+--- internal/dcraw_common.cpp~ 2016-02-24 09:04:39.000000000 -0500
++++ internal/dcraw_common.cpp  2016-02-24 09:06:31.152698597 -0500
+@@ -2469,7 +2469,7 @@
+
+ void CLASS kodak_radc_load_raw()
+ {
+-  static const char src[] = {
++  static const signed char src[] = {
+     1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8,
+     1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8,
+     2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8,
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to