diff --git a/src/map/IMG/jls.cpp b/src/map/IMG/jls.cpp index 23bdd047..3bd6f800 100644 --- a/src/map/IMG/jls.cpp +++ b/src/map/IMG/jls.cpp @@ -322,7 +322,7 @@ bool JLS::decode(const SubFile *file, SubFile::Handle &hdl, Matrix &img) if (!readLine(bs)) return false; - memcpy(&img.at(i, 0), _current + 1, _w * sizeof(quint16)); + memcpy(img.row(i), _current + 1, _w * sizeof(quint16)); quint16 *tmp = _last; _last = _current; diff --git a/src/map/matrix.h b/src/map/matrix.h index abd1b1ee..6b4aff42 100644 --- a/src/map/matrix.h +++ b/src/map/matrix.h @@ -21,6 +21,7 @@ public: T &at(int n) {return _m[n];} T &at(int i, int j) {return _m[_w * i + j];} T const &at(int i, int j) const {return _m.at(_w * i + j);} + T *row(int i) {return &_m[_w * i];} bool isNull() const {return (_h == 0 || _w == 0);} int size() const {return _m.size();}