Skip to content

Commit d4dae9a

Browse files
committed
Fix ImageTargetFileStbImage row bytes calculation for UINT8 data
The row bytes calculation was incorrectly using sizeof(float) instead of sizeof(uint8_t) for UINT8 data types, causing incorrect buffer sizes.
1 parent b7a5191 commit d4dae9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/cinder/ImageTargetFileStbImage.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ ImageTargetFileStbImage::ImageTargetFileStbImage( DataTargetRef dataTarget, Imag
8383
}
8484
else {
8585
setDataType( ImageIo::DataType::UINT8 );
86-
mRowBytes = mNumComponents * imageSource->getWidth() * sizeof(float);
86+
mRowBytes = mNumComponents * imageSource->getWidth() * sizeof(uint8_t);
8787
}
8888

8989
if( mDataTarget->providesFilePath() ) {

0 commit comments

Comments
 (0)