summaryrefslogtreecommitdiffstats
path: root/modules/tga/image_loader_tga.h
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2021-06-14 13:55:39 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2021-06-14 13:55:39 +0300
commit25cd29ae662b7acff6872e392ef0ac61edd391e7 (patch)
tree5c40c13f4a65ae646c91e68d8ce398dd20987779 /modules/tga/image_loader_tga.h
parent12e0f10c74e9619262f1edcfdc1840432ada0565 (diff)
downloadredot-engine-25cd29ae662b7acff6872e392ef0ac61edd391e7.tar.gz
Fix loading RLE compressed TGA files.
Fix memory reads outside of input buffer when loading invalid TGA files.
Diffstat (limited to 'modules/tga/image_loader_tga.h')
-rw-r--r--modules/tga/image_loader_tga.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/tga/image_loader_tga.h b/modules/tga/image_loader_tga.h
index cb2ce07edd..e4463a322f 100644
--- a/modules/tga/image_loader_tga.h
+++ b/modules/tga/image_loader_tga.h
@@ -72,8 +72,8 @@ class ImageLoaderTGA : public ImageFormatLoader {
uint8_t pixel_depth = 0;
uint8_t image_descriptor = 0;
};
- static Error decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size);
- static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome, size_t p_output_size);
+ static Error decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size, size_t p_input_size);
+ static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome, size_t p_input_size);
public:
virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale);