Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

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

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

walker-WSH
Copy link
Contributor

@walker-WSH walker-WSH commented Jan 5, 2022

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:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM
Copy link
Member

WizardCM commented Jan 5, 2022

How would a user fall into this error case?

@walker-WSH
Copy link
Contributor Author

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
Copy link
Member

WizardCM commented Jan 5, 2022

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

@walker-WSH
Copy link
Contributor Author

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
Copy link
Contributor Author

walker-WSH commented Jan 5, 2022

@WizardCM

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

1641375018

@walker-WSH walker-WSH changed the title obst-vst: Fix crash by checking hash before applying "chunk_data" obs-vst: Fix crash by checking hash before applying "chunk_data" Jan 6, 2022
@WizardCM
Copy link
Member

WizardCM commented Jan 8, 2022

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

@walker-WSH
Copy link
Contributor Author

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
Copy link
Member

WizardCM commented Jan 8, 2022

I agree.

@jp9000 jp9000 merged commit 9cdde97 into obsproject:master Jan 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants