summaryrefslogtreecommitdiff
path: root/ZAPD/ZTexture.h
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/ZTexture.h
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/ZTexture.h')
-rw-r--r--ZAPD/ZTexture.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/ZAPD/ZTexture.h b/ZAPD/ZTexture.h
index 29c3fbc..6f2c499 100644
--- a/ZAPD/ZTexture.h
+++ b/ZAPD/ZTexture.h
@@ -40,15 +40,15 @@ protected:
void PrepareBitmapPalette8();
void PrepareRawDataFromFile(const fs::path& inFolder);
- void PrepareRawDataRGBA16(const fs::path& rgbaPath);
- void PrepareRawDataRGBA32(const fs::path& rgbaPath);
- void PrepareRawDataGrayscale4(const fs::path& grayPath);
- void PrepareRawDataGrayscale8(const fs::path& grayPath);
- void PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath);
- void PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath);
- void PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath);
- void PrepareRawDataPalette4(const fs::path& palPath);
- void PrepareRawDataPalette8(const fs::path& palPath);
+ void PrepareRawDataRGBA16();
+ void PrepareRawDataRGBA32();
+ void PrepareRawDataGrayscale4();
+ void PrepareRawDataGrayscale8();
+ void PrepareRawDataGrayscaleAlpha4();
+ void PrepareRawDataGrayscaleAlpha8();
+ void PrepareRawDataGrayscaleAlpha16();
+ void PrepareRawDataPalette4();
+ void PrepareRawDataPalette8();
public:
ZTexture(ZFile* nParent);