Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin asserts when host returns a clap_host_audio_ports pointer in call to clap_host->get_extension() #5

Open
BillyDM opened this issue May 25, 2022 · 0 comments

Comments

@BillyDM
Copy link

BillyDM commented May 25, 2022

When my host returns a pointer to a clap_host_audio_ports struct after receiving the "clap.audio-ports" extension id from the plugin in clap_host->get_extension(), then the plugin later asserts with:

/home/billydm/Dev/clap-plugins/clap-helpers/include/clap/helpers/host-proxy.hxx:38: void clap::helpers::HostProxy<h, l>::getExtension(const T*&, const char*) [with T = clap_host_audio_ports; clap::helpers::MisbehaviourHandler h = clap::helpers::MisbehaviourHandler::Terminate; clap::helpers::CheckingLevel l = clap::helpers::CheckingLevel::Maximal]: Assertion `!ptr' failed.

If my host returns a nullptr instead, then the assert does not happen.

Is the assert(!ptr) assert here at line 38 of host-proxy.hxx a bug?

   template <MisbehaviourHandler h, CheckingLevel l>
   template <typename T>
   void HostProxy<h, l>::getExtension(const T *&ptr, const char *id) noexcept {
      assert(!ptr);
      assert(id);

      if (_host->get_extension)
         ptr = static_cast<const T *>(_host->get_extension(_host, id));
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant