Skip to content

Commit

Permalink
Fix a bug that could cause assertion failure. (assimp#5575)
Browse files Browse the repository at this point in the history
Co-authored-by: macmini <[email protected]>
Co-authored-by: Kim Kulling <[email protected]>
  • Loading branch information
3 people authored May 22, 2024
1 parent 6fa4f0f commit ec5242a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/Common/Bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ void Bitmap::WriteData(aiTexture *texture, IOStream *file) {

file->Write(pixel, mBytesPerPixel, 1);
}

file->Write(padding_data, padding, 1);
// When padding is 0, passing it as an argument will cause an assertion failure in DefaultIOStream::Write.
if (padding) {
file->Write(padding_data, padding, 1);
}
}
}

Expand Down

0 comments on commit ec5242a

Please sign in to comment.