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 committed Oct 31, 2023
1 parent 6b50342 commit c47300b
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 c47300b

Please sign in to comment.