buffer_size should be in bytes, not bits

(cherry picked from commit 7825cbeb7d)
pull/6448/head^2
Hajo Nils Krabbenhöft 9 years ago committed by Alexander Smorkalov
parent c5d009d6c4
commit 2fc0ce5c24
  1. 2
      modules/highgui/src/grfmt_tiff.cpp

@ -226,7 +226,7 @@ bool TiffDecoder::readData( Mat& img )
bpp = 8;
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 );
uchar* buffer = _buffer;
ushort* buffer16 = (ushort*)buffer;

Loading…
Cancel
Save