Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Fix off-by-one error in the TGA RLE decompressor
Browse files Browse the repository at this point in the history
  • Loading branch information
numberZero authored and sfan5 committed Nov 1, 2023
1 parent eafc282 commit 85081d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/Irrlicht/CImageLoaderTGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

const u32 bytesToRead = bytesPerPixel * chunkheader;
if ( currentByte+bytesToRead < imageSize )
if ( currentByte+bytesToRead <= imageSize )
{
file->read(&data[currentByte], bytesToRead);
currentByte += bytesToRead;
Expand Down

0 comments on commit 85081d6

Please sign in to comment.