Fix a bug that could cause assertion failure. (#5575)
Co-authored-by: macmini <xhnsworks2@icloud.com> Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>pull/5595/head
parent
6fa4f0ff5e
commit
ec5242a1a0
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue