diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2022-01-20 23:05:23 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-20 21:05:23 -0500 |
| commit | be71e26d9afc470a9293e74a6f56ca87f7412be0 (patch) | |
| tree | ebcaf100b26c91ef492bb139c0ee579f09a28c9e /ZAPD/ZTexture.h | |
| parent | 0ba78130478ee1272bc0e2f2fec2d162e7f7f995 (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.h | 18 |
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); |
