diff --git a/modules/highgui/src/grfmt_pxm.cpp b/modules/highgui/src/grfmt_pxm.cpp index e609d16596..36f9a059e5 100644 --- a/modules/highgui/src/grfmt_pxm.cpp +++ b/modules/highgui/src/grfmt_pxm.cpp @@ -331,7 +331,7 @@ bool PxMDecoder::readData( Mat& img ) } } else - memcpy( data, src, m_width*(bit_depth/8) ); + memcpy(data, src, img.elemSize1()*m_width); } else {