buffer_size should be in bytes, not bits

parent d38fee75
...@@ -226,7 +226,7 @@ bool TiffDecoder::readData( Mat& img ) ...@@ -226,7 +226,7 @@ bool TiffDecoder::readData( Mat& img )
bpp = 8; bpp = 8;
ncn = 4; ncn = 4;
} }
const size_t buffer_size = bpp * ncn * tile_height0 * tile_width0; const size_t buffer_size = (bpp/bitsPerByte) * ncn * tile_height0 * tile_width0;
AutoBuffer<uchar> _buffer( buffer_size ); AutoBuffer<uchar> _buffer( buffer_size );
uchar* buffer = _buffer; uchar* buffer = _buffer;
ushort* buffer16 = (ushort*)buffer; ushort* buffer16 = (ushort*)buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment