Fix use after free of new render layer ID properites after copying scene

This commit is contained in:
Sergey Sharybin 2017-05-04 12:27:28 +02:00
parent 0f4de9336a
commit ffa31a8421
1 changed files with 3 additions and 0 deletions

View File

@ -233,6 +233,9 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
/* copy Freestyle settings */
new_srl = scen->r.layers.first;
for (srl = sce->r.layers.first; srl; srl = srl->next) {
if (new_srl->prop != NULL) {
new_srl->prop = IDP_CopyProperty(new_srl->prop);
}
BKE_freestyle_config_copy(&new_srl->freestyleConfig, &srl->freestyleConfig);
if (type == SCE_COPY_FULL) {
for (lineset = new_srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {