From: Hajo Nils Krabbenhöft Date: Wed, 16 Sep 2015 20:19:51 +0000 (+0200) Subject: buffer_size should be in bytes, not bits X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~151^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7825cbeb7d70c2e1e558808d7433ece414394177;p=platform%2Fupstream%2Fopencv.git buffer_size should be in bytes, not bits --- diff --git a/modules/highgui/src/grfmt_tiff.cpp b/modules/highgui/src/grfmt_tiff.cpp index 18ec116..7871118 100644 --- a/modules/highgui/src/grfmt_tiff.cpp +++ b/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 _buffer( buffer_size ); uchar* buffer = _buffer; ushort* buffer16 = (ushort*)buffer;