Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 62ba098

Browse files
author
runrevali
committed
[[ Bug 12459 ]] Setting graphic effects to non-array value should work the same as setting them to 'empty'
1 parent 73d7c07 commit 62ba098

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docs/notes/bugfix-12459.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Setting any graphic effects to "none" crashes LC 7 dp3

engine/src/bitmapeffect.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,11 @@ bool MCBitmapEffectsSetProperty(MCExecContext& ctxt, MCBitmapEffectsRef& self, M
954954
bool t_is_array;
955955
t_is_array = MCNameIsEmpty(p_index);
956956

957-
if (t_is_array && p_value . type == kMCExecValueTypeValueRef && MCValueIsEmpty(p_value . valueref_value))
957+
// AL-2014-05-21: [[ Bug 12459 ]] Ensure setting bitmap effect to anything
958+
// that isn't an array does the same as setting it to 'empty'.
959+
if (p_value . type == kMCExecValueTypeValueRef &&
960+
(MCValueIsEmpty(p_value . valueref_value) ||
961+
(MCValueGetTypeCode(p_value . valueref_value) != kMCValueTypeCodeArray)))
958962
{
959963
if (self == nil || (self -> mask & (1 << t_type)) == 0)
960964
{

engine/src/gradient.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,11 @@ bool MCGradientFillSetProperties(MCExecContext& ctxt, MCGradientFill*& x_gradien
953953

954954
uint4 tablesize = ELEMENTS(gradientprops);
955955

956-
if (p_value . type == kMCExecValueTypeValueRef && MCValueIsEmpty(p_value . valueref_value))
956+
// AL-2014-05-21: [[ Bug 12459 ]] Ensure setting gradient property to anything
957+
// that isn't an array does the same as setting it to 'empty'.
958+
if (p_value . type == kMCExecValueTypeValueRef &&
959+
(MCValueIsEmpty(p_value . valueref_value) ||
960+
(MCValueGetTypeCode(p_value . valueref_value) != kMCValueTypeCodeArray)))
957961
{
958962
delete t_gradient;
959963
t_gradient = nil;

0 commit comments

Comments
 (0)