From db0ae2ca5030c03b2b1c331efc314ff1a5e3e1aa Mon Sep 17 00:00:00 2001 From: "Kevin, Hu" Date: Tue, 19 Apr 2016 19:27:42 +0800 Subject: [PATCH] Restore 2.4 source branch for bug fix 6317. --- modules/highgui/src/grfmt_png.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/highgui/src/grfmt_png.cpp b/modules/highgui/src/grfmt_png.cpp index bbbfb94faa..22160a9546 100644 --- a/modules/highgui/src/grfmt_png.cpp +++ b/modules/highgui/src/grfmt_png.cpp @@ -228,8 +228,6 @@ bool PngDecoder::readData( Mat& img ) AutoBuffer _buffer(m_height); uchar** buffer = _buffer; int color = img.channels() > 1; - uchar* data = img.data; - int step = (int)img.step; if( m_png_ptr && m_info_ptr && m_end_info && m_width && m_height ) { @@ -281,7 +279,7 @@ bool PngDecoder::readData( Mat& img ) png_read_update_info( png_ptr, info_ptr ); for( y = 0; y < m_height; y++ ) - buffer[y] = data + y*step; + buffer[y] = img.data + y*img.step; png_read_image( png_ptr, buffer ); png_read_end( png_ptr, end_info );