[opencv] 02/19: fix crash for large BW tif images

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 c5d009d6c4ddf03f4b45acc544b436ca004a41f2
Author: Hajo Nils Krabbenhöft <fxtentacle at googlemail.com>
Date:   Wed Sep 16 22:04:42 2015 +0200

    fix crash for large BW tif images
    
    (cherry picked from commit d38fee759928d631ea2947c67e5ee9eb347693b6)
---
 modules/highgui/src/grfmt_tiff.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/highgui/src/grfmt_tiff.cpp b/modules/highgui/src/grfmt_tiff.cpp
index eeee318..067f22d 100644
--- a/modules/highgui/src/grfmt_tiff.cpp
+++ b/modules/highgui/src/grfmt_tiff.cpp
@@ -221,6 +221,11 @@ bool  TiffDecoder::readData( Mat& img )
                 (!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) )
                 tile_height0 = m_height;
 
+            if(dst_bpp == 8) {
+                // we will use TIFFReadRGBA* functions, so allocate temporary buffer for 32bit RGBA
+                bpp = 8;
+                ncn = 4;
+            }
             const size_t buffer_size = bpp * ncn * tile_height0 * tile_width0;
             AutoBuffer<uchar> _buffer( buffer_size );
             uchar* buffer = _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