diff --git a/src/simpleocv.h b/src/simpleocv.h index 54b22d9f9..015e48b4c 100644 --- a/src/simpleocv.h +++ b/src/simpleocv.h @@ -398,13 +398,13 @@ struct NCNN_EXPORT Mat template const _Tp* ptr(int y) const { - return (const _Tp*)data + y * cols * c; + return (const _Tp*)(data + y * cols * c); } template _Tp* ptr(int y) { - return (_Tp*)data + y * cols * c; + return (_Tp*)(data + y * cols * c); } // roi