[babl] Bug 788093 - Crash loading (jpg with) ICC v4 profile with parametric TRCs



commit ed2d4e03d1221d4f11be77d567420dd36cea4acf
Author: Ell <ell_se yahoo com>
Date:   Sun Sep 24 17:34:00 2017 -0400

    Bug 788093 - Crash loading (jpg with) ICC v4 profile with parametric TRCs
    
    Fix parameter offset calculation of parametric TRCs, so that we
    parse them correctry.

 babl/babl-icc.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/babl/babl-icc.c b/babl/babl-icc.c
index fe146f6..0f05c90 100644
--- a/babl/babl-icc.c
+++ b/babl/babl-icc.c
@@ -312,17 +312,17 @@ static const Babl *babl_trc_from_icc (ICC  *state, int offset,
          switch (function_type)
          {
             case 0:
-              g = icc_read (s15f16, offset + 12 + 2 * 0);
+              g = icc_read (s15f16, offset + 12 + 4 * 0);
               return babl_trc_gamma (g);
               break;
             case 3:
               {
                 float a,b,c,d;
-                g = icc_read (s15f16, offset + 12 + 2 * 0);
-                a = icc_read (s15f16, offset + 12 + 2 * 1);
-                b = icc_read (s15f16, offset + 12 + 2 * 2);
-                c = icc_read (s15f16, offset + 12 + 2 * 3);
-                d = icc_read (s15f16, offset + 12 + 2 * 4);
+                g = icc_read (s15f16, offset + 12 + 4 * 0);
+                a = icc_read (s15f16, offset + 12 + 4 * 1);
+                b = icc_read (s15f16, offset + 12 + 4 * 2);
+                c = icc_read (s15f16, offset + 12 + 4 * 3);
+                d = icc_read (s15f16, offset + 12 + 4 * 4);
                 //fprintf (stderr, "%f %f %f %f %f\n", g, a, b, c, d);
                 return babl_trc_formula_srgb (g, a, b, c, d);
               }
@@ -330,13 +330,13 @@ static const Babl *babl_trc_from_icc (ICC  *state, int offset,
             case 4:
               {
                 float a,b,c,d,e,f;
-                g = icc_read (s15f16, offset + 12 + 2 * 0);
-                a = icc_read (s15f16, offset + 12 + 2 * 1);
-                b = icc_read (s15f16, offset + 12 + 2 * 2);
-                c = icc_read (s15f16, offset + 12 + 2 * 3);
-                d = icc_read (s15f16, offset + 12 + 2 * 4);
-                e = icc_read (s15f16, offset + 12 + 2 * 5);
-                f = icc_read (s15f16, offset + 12 + 2 * 6);
+                g = icc_read (s15f16, offset + 12 + 4 * 0);
+                a = icc_read (s15f16, offset + 12 + 4 * 1);
+                b = icc_read (s15f16, offset + 12 + 4 * 2);
+                c = icc_read (s15f16, offset + 12 + 4 * 3);
+                d = icc_read (s15f16, offset + 12 + 4 * 4);
+                e = icc_read (s15f16, offset + 12 + 4 * 5);
+                f = icc_read (s15f16, offset + 12 + 4 * 6);
                 fprintf (stderr, "%f %f %f %f %f %f %f\n",
                               g, a, b, c, d, e, f);
             {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]