mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
prevent crash is VST does not implement effEditGetRect
This commit is contained in:
parent
43d3b4656a
commit
13552140a2
1 changed files with 9 additions and 5 deletions
|
|
@ -689,7 +689,7 @@ vstfx_launch_editor (VSTState* vstfx)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Window parent_window;
|
Window parent_window;
|
||||||
struct ERect* er;
|
struct ERect* er = NULL;
|
||||||
|
|
||||||
int x_size = 1;
|
int x_size = 1;
|
||||||
int y_size = 1;
|
int y_size = 1;
|
||||||
|
|
@ -724,8 +724,12 @@ vstfx_launch_editor (VSTState* vstfx)
|
||||||
|
|
||||||
vstfx->plugin->dispatcher (vstfx->plugin, effEditGetRect, 0, 0, &er, 0 );
|
vstfx->plugin->dispatcher (vstfx->plugin, effEditGetRect, 0, 0, &er, 0 );
|
||||||
|
|
||||||
|
if (er) {
|
||||||
|
// Don't crash is plugin does not implement effEditGetRect
|
||||||
|
// it'll result in 1x1 px window but that's not our problem :)
|
||||||
x_size = er->right - er->left;
|
x_size = er->right - er->left;
|
||||||
y_size = er->bottom - er->top;
|
y_size = er->bottom - er->top;
|
||||||
|
}
|
||||||
|
|
||||||
vstfx->width = x_size;
|
vstfx->width = x_size;
|
||||||
vstfx->height = y_size;
|
vstfx->height = y_size;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue