mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Added sanity checks
This commit is contained in:
parent
3f3ac6e093
commit
39dd5ceba0
@ -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
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user