1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Added sanity checks

This commit is contained in:
Martin Tůma 2024-05-27 17:56:45 +02:00
parent 3f3ac6e093
commit 39dd5ceba0
2 changed files with 3 additions and 1 deletions

View File

@ -33,7 +33,7 @@ bool HuffmanTable::load(const RGNFile *rgn, SubFile::Handle &rgnHdl)
_aclTable = _bsrchTable + _bsrchEntryBytes * _bsrchEntries; _aclTable = _bsrchTable + _bsrchEntryBytes * _bsrchEntries;
_huffmanTable = _aclTable + (_aclEntryBytes << _aclBits); _huffmanTable = _aclTable + (_aclEntryBytes << _aclBits);
return (_symBits <= 32 && _symbolBits <= 32); return (_symBits > 0 && _symBits <= 32 && _symbolBits <= 32);
} }
quint32 HuffmanTable::symbol(quint32 data, quint8 &size) const quint32 HuffmanTable::symbol(quint32 data, quint8 &size) const

View File

@ -78,6 +78,8 @@ QImage HillShading::render(const MatrixD &m, int extend)
getConstants(_azimuth, _altitude, c); getConstants(_azimuth, _altitude, c);
Q_ASSERT(extend > 0);
for (int y = extend; y < m.h() - extend; y++) { for (int y = extend; y < m.h() - extend; y++) {
for (int x = extend; x < m.w() - extend; x++) { for (int x = extend; x < m.w() - extend; x++) {
getSubmatrix(x, y, m, sm); getSubmatrix(x, y, m, sm);