summaryrefslogtreecommitdiff
path: root/ZAPD/ZAnimation.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2022-01-20 23:05:23 -0300
committerGitHub <noreply@github.com>2022-01-20 21:05:23 -0500
commitbe71e26d9afc470a9293e74a6f56ca87f7412be0 (patch)
treeebcaf100b26c91ef492bb139c0ee579f09a28c9e /ZAPD/ZAnimation.cpp
parent0ba78130478ee1272bc0e2f2fec2d162e7f7f995 (diff)
Fix out-of-bounds reading when converting textures to C (#236)
* Fill buffer to a multiple of 8 bytes * Remove overloaded bitconverter methods and use boundary-checker .at method when possible * Add a warning in oob reads in the bitconverter * Remove repeated code * format * Whoops * whoops++
Diffstat (limited to 'ZAPD/ZAnimation.cpp')
-rw-r--r--ZAPD/ZAnimation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ZAPD/ZAnimation.cpp b/ZAPD/ZAnimation.cpp
index 4d9266b..74b520b 100644
--- a/ZAPD/ZAnimation.cpp
+++ b/ZAPD/ZAnimation.cpp
@@ -51,7 +51,7 @@ void ZNormalAnimation::ParseRawData()
{
ZAnimation::ParseRawData();
- const uint8_t* data = parent->GetRawData().data();
+ auto& data = parent->GetRawData();
rotationValuesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 4);
rotationIndicesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 8);