Fix for unlikely NULL pointer dereference
Potential crash reading freestyle modifiers from future blend-files
This commit is contained in:
@@ -280,6 +280,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyl
|
||||
LineStyleModifier *m;
|
||||
|
||||
m = alloc_color_modifier(name, type);
|
||||
if (UNLIKELY(m == NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
m->blend = MA_RAMP_BLEND;
|
||||
|
||||
switch (type) {
|
||||
@@ -314,6 +317,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linesty
|
||||
LineStyleModifier *new_m;
|
||||
|
||||
new_m = alloc_color_modifier(m->name, m->type);
|
||||
if (UNLIKELY(new_m == NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
new_m->influence = m->influence;
|
||||
new_m->flags = m->flags;
|
||||
new_m->blend = m->blend;
|
||||
|
||||
Reference in New Issue
Block a user