obsproject / obs-vst

Use VST plugins in OBS
GNU General Public License v2.0
181 stars 56 forks source link

obs-vst: Fix crash by checking hash before applying "chunk_data" #101

Closed walker-WSH closed 2 years ago

walker-WSH commented 2 years ago

Description

Before applying chunk-data, we should check if data is for this VST plugin. Some VST plugin will crash at effSetChunk if chunk-data is not for it. Besides, it is meaningless to apply chunk-data to a mismatched VST plugin.

For example: 1641373391

It can also be reproduced with: readelay-standalone.dll BL-Denoiser.dll spire-1.5.dll

Motivation and Context

Fix crash

How Has This Been Tested?

switch selected VST and reboot OBS

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

WizardCM commented 2 years ago

How would a user fall into this error case?

walker-WSH commented 2 years ago

How would a user fall into this error case?

How to reproduce this crash ?

  1. add VST filter for audio source, select any available VST plugin (eg: named "VST-1");
  2. exit OBS, then chunk-data of "VST-1" will be saved;
  3. run OBS, switch VST plugin from VST-1 to "BC Triple EQ 4 VST"; chunk-data of "VST-1" will be applied to "BC Triple EQ", then crash!
WizardCM commented 2 years ago

Could you list a couple of free VST plugins that this issue can be reproduced with?

walker-WSH commented 2 years ago

Could you list a couple of free VST plugins that this issue can be reproduced with?

I have attached a image for free VST plugin, you can use it to reproduce.

walker-WSH commented 2 years ago

@WizardCM

this VST plugin can also be used to reproduce: readelay-standalone.dll BL-Denoiser.dll spire-1.5.dll

1641375018

WizardCM commented 2 years ago

Unfortunately I am unable to reproduce this crash on current master.

walker-WSH commented 2 years ago

Unfortunately I am unable to reproduce this crash on current master.

That is strange. I can reproduce it every time with the given Plugins. I tried apply chunk-data of different Plugin to the given Plugins, crash still happen.

Even you can't reproduce it, we should not apply chunk-data of plugin A to plugin B. So I think this commit is necessary.

WizardCM commented 2 years ago

I agree.