swami / libinstpatch

Instrument file software library.
Other
20 stars 6 forks source link

Fix a bug in paste operations. #43

Closed jjceresa closed 4 years ago

jjceresa commented 4 years ago

During a copy/paste of instrument(s) in Instrument pool (or copy/paste of preset(s) in Preset pool), paste operation fails. For example in swami following critical messages occur.

The bug is inipatch_item_copy_link_func(). This function is called by ipatch_item_duplicate() or ipatch_item_duplicate_link_func(). In the case of ipatch_item_duplicate(), the function is called by ipatch_item_copy() using the class method klass->copy(dest, src, NULL, NULL). As the method implemented by derived IpatchItem objects (IpatchSF2Inst, IpatchSF2Preset,...) is calling ipatch_item_duplicate_link_func(), that leads to link_func parameter set to NULL which is a valid parameter.

ipatch_item_copy_link_func(), should ignore if link_func parameter is NULL.