Fix for unlikely NULL pointer dereference
Potential crash reading freestyle modifiers from future blend-files
This commit is contained in:
@@ -2102,7 +2102,7 @@ static float fcurve_eval_keyframes(FCurve *fcu, BezTriple *bezts, float evaltime
|
|||||||
* This lower bound was established in b888a32eee8147b028464336ad2404d8155c64dd
|
* This lower bound was established in b888a32eee8147b028464336ad2404d8155c64dd
|
||||||
*/
|
*/
|
||||||
a = binarysearch_bezt_index_ex(bezts, evaltime, fcu->totvert, 0.0001, &exact);
|
a = binarysearch_bezt_index_ex(bezts, evaltime, fcu->totvert, 0.0001, &exact);
|
||||||
if (G.debug & G_DEBUG) printf("eval fcurve '%s' - %f => %d/%d, %d\n", fcu->rna_path, evaltime, a, fcu->totvert, exact);
|
if (G.debug & G_DEBUG) printf("eval fcurve '%s' - %f => %u/%u, %d\n", fcu->rna_path, evaltime, a, fcu->totvert, exact);
|
||||||
|
|
||||||
if (exact) {
|
if (exact) {
|
||||||
/* index returned must be interpreted differently when it sits on top of an existing keyframe
|
/* index returned must be interpreted differently when it sits on top of an existing keyframe
|
||||||
|
|||||||
@@ -280,6 +280,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyl
|
|||||||
LineStyleModifier *m;
|
LineStyleModifier *m;
|
||||||
|
|
||||||
m = alloc_color_modifier(name, type);
|
m = alloc_color_modifier(name, type);
|
||||||
|
if (UNLIKELY(m == NULL)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
m->blend = MA_RAMP_BLEND;
|
m->blend = MA_RAMP_BLEND;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -314,6 +317,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linesty
|
|||||||
LineStyleModifier *new_m;
|
LineStyleModifier *new_m;
|
||||||
|
|
||||||
new_m = alloc_color_modifier(m->name, m->type);
|
new_m = alloc_color_modifier(m->name, m->type);
|
||||||
|
if (UNLIKELY(new_m == NULL)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
new_m->influence = m->influence;
|
new_m->influence = m->influence;
|
||||||
new_m->flags = m->flags;
|
new_m->flags = m->flags;
|
||||||
new_m->blend = m->blend;
|
new_m->blend = m->blend;
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ bool GPU_fx_compositor_initialize_passes(
|
|||||||
int w = BLI_rcti_size_x(rect), h = BLI_rcti_size_y(rect);
|
int w = BLI_rcti_size_x(rect), h = BLI_rcti_size_y(rect);
|
||||||
char err_out[256];
|
char err_out[256];
|
||||||
int num_passes = 0;
|
int num_passes = 0;
|
||||||
char fx_flag = fx_settings->fx_flag;
|
char fx_flag;
|
||||||
|
|
||||||
fx->effects = 0;
|
fx->effects = 0;
|
||||||
|
|
||||||
@@ -276,6 +276,8 @@ bool GPU_fx_compositor_initialize_passes(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fx_flag = fx_settings->fx_flag;
|
||||||
|
|
||||||
/* disable effects if no options passed for them */
|
/* disable effects if no options passed for them */
|
||||||
if (!fx_settings->dof) {
|
if (!fx_settings->dof) {
|
||||||
fx_flag &= ~GPU_FX_FLAG_DOF;
|
fx_flag &= ~GPU_FX_FLAG_DOF;
|
||||||
|
|||||||
@@ -928,7 +928,6 @@ bool RE_bake_internal(
|
|||||||
case SCE_PASS_UV:
|
case SCE_PASS_UV:
|
||||||
{
|
{
|
||||||
return bake_uv(pixel_array, num_pixels, depth, result);
|
return bake_uv(pixel_array, num_pixels, depth, result);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user