Kaynağa Gözat

Fix a bug that could cause assertion failure. (#5575)

Co-authored-by: macmini <[email protected]>
Co-authored-by: Kim Kulling <[email protected]>
vengine 1 yıl önce
ebeveyn
işleme
ec5242a1a0
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      code/Common/Bitmap.cpp

+ 4 - 2
code/Common/Bitmap.cpp

@@ -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);
+        }
     }
 }