mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-27 19:20:31 +01:00
Fix off-by-one error in the TGA RLE decompressor
This commit is contained in:
parent
eafc282efd
commit
85081d6fe0
@ -46,7 +46,7 @@ u8 *CImageLoaderTGA::loadCompressedImage(io::IReadFile *file, const STGAHeader&
|
|||||||
chunkheader++; // Add 1 To The Value To Get Total Number Of Raw Pixels
|
chunkheader++; // Add 1 To The Value To Get Total Number Of Raw Pixels
|
||||||
|
|
||||||
const u32 bytesToRead = bytesPerPixel * chunkheader;
|
const u32 bytesToRead = bytesPerPixel * chunkheader;
|
||||||
if ( currentByte+bytesToRead < imageSize )
|
if ( currentByte+bytesToRead <= imageSize )
|
||||||
{
|
{
|
||||||
file->read(&data[currentByte], bytesToRead);
|
file->read(&data[currentByte], bytesToRead);
|
||||||
currentByte += bytesToRead;
|
currentByte += bytesToRead;
|
||||||
|
Loading…
Reference in New Issue
Block a user