Skip to content

Commit 28fa57d

Browse files
committed
Added a check in the patch player if no sample rate or block size is provided
1 parent ab597cc commit 28fa57d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/modules/soul_patch_loader/classes/soul_patch_PlayerImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ struct PatchPlayerImpl : public RefCountHelper<PatchPlayer>
477477

478478
EndpointProperties getEndpointProperties() const
479479
{
480+
if (config.sampleRate <= 0) throwPatchLoadError ("Illegal sample rate");
481+
if (config.maxFramesPerBlock <= 0) throwPatchLoadError ("Illegal block size");
482+
480483
return { config.sampleRate, (uint32_t) config.maxFramesPerBlock };
481484
}
482485

0 commit comments

Comments
 (0)