From d5f35582d4044362be507b83b76ed0b7822c071a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 30 Jan 2024 10:35:22 +0100 Subject: [PATCH] Introduce aiBuffer We have a lot of parsing tools which are not doing any kind of bound checking. This is the first approach to solve these issues. --- include/assimp/types.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/assimp/types.h b/include/assimp/types.h index 42aa0f9eb..ea72dd996 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2022, assimp team +Copyright (c) 2006-2024, assimp team All rights reserved. @@ -523,6 +523,23 @@ struct aiMemoryInfo { unsigned int total; }; // !struct aiMemoryInfo +/** + * @brief Type to store a in-memory data buffer. + */ +struct aiBuffer { + const char *data; ///< Begin poiner + const char *end; ///< End pointer + +#ifdef __cplusplus + /// @brief The class constructor. + aiBuffer() : + data(nullptr), end(nullptr) {} + + /// @brief The class destructor. + ~aiBuffer() = default; +#endif //! __cplusplus +}; + #ifdef __cplusplus } #endif //! __cplusplus