Source:clone fixes;
Clones no longer try to create converters if they aren't needed, which
was causing an error.
Also handle malloc failure.
@@ -452,9 +452,12 @@ Source* lovrSourceClone(Source* source) {
clone->dipolePower = source->dipolePower;
clone->effects = source->effects;
clone->looping = source->looping;
+ if (source->converter) {
clone->converter = malloc(sizeof(ma_data_converter));
+ lovrAssert(clone->converter, "Out of memory");
ma_result status = ma_data_converter_init(&source->converter->config, clone->converter);
lovrAssert(status == MA_SUCCESS, "Problem creating Source data converter: %s (%d)", ma_result_description(status), status);
+ }
return clone;
}
