diff --git a/modules/imgcodecs/src/grfmt_pxm.cpp b/modules/imgcodecs/src/grfmt_pxm.cpp index 051922df39..8afd7b18b4 100644 --- a/modules/imgcodecs/src/grfmt_pxm.cpp +++ b/modules/imgcodecs/src/grfmt_pxm.cpp @@ -309,7 +309,7 @@ bool PxMDecoder::readData( Mat& img ) } } else - memcpy( data, src, m_width); + memcpy( data, src, CV_ELEM_SIZE1(m_type)*m_width); } else {