[X2Go-Commits] [pale-moon] 14/22: Reject some invalid qcms transforms.

git-admin at x2go.org git-admin at x2go.org
Sat Sep 29 03:25:23 CEST 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch upstream/palemoon-master
in repository pale-moon.

commit f929ffa0e3f379de95a5e074e4058ce3fd6aabfb
Author: Pale Moon <git-repo at palemoon.org>
Date:   Sun Jul 1 13:33:39 2018 +0200

    Reject some invalid qcms transforms.
    
    Note: Only reject qcms transform with invalid grid size if the transform function uses the grid size.
    Some transform functions don't use the table and grid size, and therefore are expected to work
    without valid values in these members, so we should not reject these.
---
 gfx/qcms/chain.c           | 6 ++++++
 gfx/thebes/gfxPlatform.cpp | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gfx/qcms/chain.c b/gfx/qcms/chain.c
index edc9171..125b0de 100644
--- a/gfx/qcms/chain.c
+++ b/gfx/qcms/chain.c
@@ -968,6 +968,12 @@ static float* qcms_modular_transform_data(struct qcms_modular_transform *transfo
 			assert(0 && "Unsupported transform module");
 			return NULL;
 		}
+		if (transform->grid_size <= 0 &&
+			(transform_fn == qcms_transform_module_clut ||
+			 transform_fn == qcms_transform_module_clut_only)) {
+			assert(0 && "Invalid transform");
+			return NULL;
+		}
                 transform->transform_module_fn(transform,src,dest,len);
                 dest = src;
                 src = new_src;
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index ed1b2ff..3762f5f 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -125,6 +125,7 @@ static Mutex* gGfxPlatformPrefsLock = nullptr;
 static qcms_profile *gCMSOutputProfile = nullptr;
 static qcms_profile *gCMSsRGBProfile = nullptr;
 
+static bool gCMSRGBTransformFailed = false;
 static qcms_transform *gCMSRGBTransform = nullptr;
 static qcms_transform *gCMSInverseRGBTransform = nullptr;
 static qcms_transform *gCMSRGBATransform = nullptr;
@@ -1902,7 +1903,7 @@ gfxPlatform::GetCMSsRGBProfile()
 qcms_transform *
 gfxPlatform::GetCMSRGBTransform()
 {
-    if (!gCMSRGBTransform) {
+    if (!gCMSRGBTransform && !gCMSRGBTransformFailed) {
         qcms_profile *inProfile, *outProfile;
         outProfile = GetCMSOutputProfile();
         inProfile = GetCMSsRGBProfile();
@@ -1913,6 +1914,9 @@ gfxPlatform::GetCMSRGBTransform()
         gCMSRGBTransform = qcms_transform_create(inProfile, QCMS_DATA_RGB_8,
                                               outProfile, QCMS_DATA_RGB_8,
                                              QCMS_INTENT_PERCEPTUAL);
+        if (!gCMSRGBTransform) {
+            gCMSRGBTransformFailed = true;
+        }
     }
 
     return gCMSRGBTransform;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git


More information about the x2go-commits mailing list