clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit a1f239f13504e41a6a69532e5a9d791f8ea7b15b
parent 8cce2c8aa288282f051a3fe32a82d37cbad01554
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Tue,  7 Sep 2021 17:51:21 +0200

More checks

Diffstat:
Mexamples/glue/clap-plugin.cc | 22++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/examples/glue/clap-plugin.cc b/examples/glue/clap-plugin.cc @@ -445,7 +445,16 @@ namespace clap { return false; } - // TODO: extra checks + if (!display) { + self.hostMisbehaving("clap_plugin_params.value_to_text called with a null display pointer"); + return false; + } + + if (size <= 1) { + self.hostMisbehaving("clap_plugin_params.value_to_text called with a empty buffer (less than one character)"); + return false; + } + return self.paramsValueToText(param_id, value, display, size); } @@ -463,7 +472,16 @@ namespace clap { return false; } - // TODO: extra checks + if (!display) { + self.hostMisbehaving("clap_plugin_params.text_to_value called with a null display pointer"); + return false; + } + + if (!value) { + self.hostMisbehaving("clap_plugin_params.text_to_value called with a null value pointer"); + return false; + } + return self.paramsTextToValue(param_id, display, value); }