summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-12 08:38:46 +0200
committerGitHub <noreply@github.com>2021-10-12 08:38:46 +0200
commit0fd50ff21777e74258ba5a38e9c32b27cf0784b2 (patch)
treef8796d2d0081664e729762194ea194d64f8ce79c /platform/javascript
parent34624068583e472cc69c6864be360821265e764b (diff)
parent7e51e4cb84aeb3c191289752e0e6b92facd8f7f6 (diff)
Merge pull request #52736 from aaronfranke/lgtm-mult
Fix some LGTM errors of "Multiplication result converted to larger type"
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/audio_driver_javascript.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp
index cfe6c69072..626aef3c60 100644
--- a/platform/javascript/audio_driver_javascript.cpp
+++ b/platform/javascript/audio_driver_javascript.cpp
@@ -117,14 +117,15 @@ Error AudioDriverJavaScript::init() {
if (output_rb) {
memdelete_arr(output_rb);
}
- output_rb = memnew_arr(float, buffer_length *channel_count);
+ const size_t array_size = buffer_length * (size_t)channel_count;
+ output_rb = memnew_arr(float, array_size);
if (!output_rb) {
return ERR_OUT_OF_MEMORY;
}
if (input_rb) {
memdelete_arr(input_rb);
}
- input_rb = memnew_arr(float, buffer_length *channel_count);
+ input_rb = memnew_arr(float, array_size);
if (!input_rb) {
return ERR_OUT_OF_MEMORY;
}