aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/utility
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-04-22 01:25:41 +0200
committer GitHub <noreply@github.com>2024-04-22 01:25:41 +0200
commit34f161570fd7ca9381675be8a9ec3b9b409929e1 (patch)
treeedba52a563952d2cf14c6d8f2a4995ac8017c147 /extension/src/openvic-extension/utility
parent00c03db2b10588081548b713a4272854a9051c1c (diff)
parent5192708bda86625a40ce67ff297dca8138f9cc13 (diff)
Merge pull request #218 from OpenVicProject/array-dict-tweaks
Pre-allocate and use std::move for Godot Arrays and Dictionaries
Diffstat (limited to 'extension/src/openvic-extension/utility')
-rw-r--r--extension/src/openvic-extension/utility/Utilities.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/utility/Utilities.cpp b/extension/src/openvic-extension/utility/Utilities.cpp
index 7450212..4389e95 100644
--- a/extension/src/openvic-extension/utility/Utilities.cpp
+++ b/extension/src/openvic-extension/utility/Utilities.cpp
@@ -80,7 +80,8 @@ static Ref<Image> load_dds_image(String const& path) {
);
PackedByteArray pixels;
- pixels.resize(size);
+ ERR_FAIL_COND_V(pixels.resize(size) != OK, nullptr);
+
/* Index offset used to control whether we are reading */
const size_t rb_idx = 2 * needs_bgr_to_rgb;
uint8_t const* ptr = static_cast<uint8_t const*>(texture.data());