This patch fixes T84588's second issue. The particle parameter is optional in the Python API of bpy.types.ParticleSystem.uv_on_emitter, however it isn't properly validated that it may be None. This lead to the dereferencing of a NULL-pointer in rna_ParticleSystem_tessfaceidx_on_emitter called by rna_ParticleSystem_uv_on_emitter. The fix is to add a NULL check and return a negative value like when the other pointers are NULL.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
Seems like the error is actually in rna.
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index c42d891c389..ab8c1b0bb3f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -4016,7 +4016,7 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); - prop = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); + parm = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); RNA_def_int(func, "uv_no", 0, INT_MIN, INT_MAX, "UV no", "", INT_MIN, INT_MAX);
Comment Actions
@Jacques Lucke (JacquesLucke) it looks like you're absolutely right and the parameter was never intended to be optional. I will update the patch accordingly.
Comment Actions
The parameter was never intended to be optional, it was a mistake in the parameter's definition