Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 8986149 Details for
Bug 1464039
[patch]
Only reject invalid grid sizes if teh transform uses the grid size.
slow-failed-qcms-transform (text/plain), 4.27 KB, created by
Nicolas Silva [:nical]
(
hide
)
Description:
Only reject invalid grid sizes if teh transform uses the grid size.
Filename:
MIME Type:
Creator:
Nicolas Silva [:nical]
Size:
4.27 KB
patch
obsolete
># HG changeset patch ># User Nicolas Silva <nsilva@mozilla.com> ># Parent 0dd11aad5c51595ee924c94f8542d0e999d0f8a9 >Bug 1464039 - Only reject qcms transform with invalid grid size if the transform function uses the grid size. r=Bas > >diff --git a/gfx/qcms/chain.c b/gfx/qcms/chain.c >--- a/gfx/qcms/chain.c >+++ b/gfx/qcms/chain.c >@@ -128,19 +128,22 @@ static void qcms_transform_module_clut_o > size_t i; > int xy_len = 1; > int x_len = transform->grid_size; > int len = x_len * x_len; > float* r_table = transform->r_clut; > float* g_table = transform->g_clut; > float* b_table = transform->b_clut; > >+ if (transform->grid_size <= 0) { >+ assert(0 && "Invalid transform"); >+ return NULL; >+ } >+ > for (i = 0; i < length; i++) { >- assert(transform->grid_size >= 1); >- > float linear_r = *src++; > float linear_g = *src++; > float linear_b = *src++; > > int x = floorf(linear_r * (transform->grid_size-1)); > int y = floorf(linear_g * (transform->grid_size-1)); > int z = floorf(linear_b * (transform->grid_size-1)); > int x_n = ceilf(linear_r * (transform->grid_size-1)); >@@ -184,18 +187,23 @@ static void qcms_transform_module_clut(s > { > size_t i; > int xy_len = 1; > int x_len = transform->grid_size; > int len = x_len * x_len; > float* r_table = transform->r_clut; > float* g_table = transform->g_clut; > float* b_table = transform->b_clut; >+ >+ if (transform->grid_size <= 0) { >+ assert(0 && "Invalid transform"); >+ return NULL; >+ } >+ > for (i = 0; i < length; i++) { >- assert(transform->grid_size >= 1); > > float device_r = *src++; > float device_g = *src++; > float device_b = *src++; > float linear_r = lut_interp_linear_float(device_r, > transform->input_clut_table_r, transform->input_clut_table_length); > float linear_g = lut_interp_linear_float(device_g, > transform->input_clut_table_g, transform->input_clut_table_length); >@@ -967,20 +975,16 @@ static float* qcms_modular_transform_dat > transform_fn != qcms_transform_module_clut_only && > transform_fn != qcms_transform_module_matrix && > transform_fn != qcms_transform_module_matrix_translate && > transform_fn != qcms_transform_module_LAB_to_XYZ && > transform_fn != qcms_transform_module_XYZ_to_LAB) { > assert(0 && "Unsupported transform module"); > return NULL; > } >- if (transform->grid_size <= 0) { >- assert(0 && "Invalid transform"); >- return NULL; >- } > transform->transform_module_fn(transform,src,dest,len); > dest = src; > src = new_src; > transform = transform->next_transform; > } > // The results end up in the src buffer because of the switching > return src; > } >diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp >--- a/gfx/thebes/gfxPlatform.cpp >+++ b/gfx/thebes/gfxPlatform.cpp >@@ -157,16 +157,17 @@ static bool gEverInitialized = false; > const ContentDeviceData* gContentDeviceInitData = nullptr; > > static Mutex* gGfxPlatformPrefsLock = nullptr; > > // These two may point to the same profile > 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; > > static bool gCMSInitialized = false; > static eCMSMode gCMSMode = eCMSMode_Off; > > static void ShutdownCMS(); >@@ -2083,27 +2084,30 @@ gfxPlatform::GetCMSsRGBProfile() > gCMSsRGBProfile = qcms_profile_sRGB(); > } > return gCMSsRGBProfile; > } > > qcms_transform * > gfxPlatform::GetCMSRGBTransform() > { >- if (!gCMSRGBTransform) { >+ if (!gCMSRGBTransform && !gCMSRGBTransformFailed) { > qcms_profile *inProfile, *outProfile; > outProfile = GetCMSOutputProfile(); > inProfile = GetCMSsRGBProfile(); > > if (!inProfile || !outProfile) > return nullptr; > > gCMSRGBTransform = qcms_transform_create(inProfile, QCMS_DATA_RGB_8, > outProfile, QCMS_DATA_RGB_8, > QCMS_INTENT_PERCEPTUAL); >+ if (!gCMSRGBTransform) { >+ gCMSRGBTransformFailed = true; >+ } > } > > return gCMSRGBTransform; > } > > qcms_transform * > gfxPlatform::GetCMSInverseRGBTransform() > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 1464039
:
8980251
|
8985672
|
8986149
|
8986151