[opencv] 03/19: buffer_size should be in bytes, not bits

Mattia Rizzolo mattia at debian.org
Tue Oct 4 17:51:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to annotated tag 2.4.12.3
in repository opencv.

commit 2fc0ce5c246a70c83691e7f1afd689457e25e70f
Author: Hajo Nils Krabbenhöft <fxtentacle at googlemail.com>
Date:   Wed Sep 16 22:19:51 2015 +0200

    buffer_size should be in bytes, not bits
    
    (cherry picked from commit 7825cbeb7d70c2e1e558808d7433ece414394177)
---
 modules/highgui/src/grfmt_tiff.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/highgui/src/grfmt_tiff.cpp b/modules/highgui/src/grfmt_tiff.cpp
index 067f22d..c7639fe 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<uchar> _buffer( buffer_size );
             uchar* buffer = _buffer;
             ushort* buffer16 = (ushort*)buffer;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list