1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Use a less restrictive check

(some rmaps contain tiles with exceeding image data)
This commit is contained in:
Martin Tůma 2019-03-09 12:09:43 +01:00
parent 46d6fbe5de
commit b58adc5486

View File

@ -354,7 +354,7 @@ QPixmap RMap::tile(int x, int y)
if (stream.readRawData(ba.data() + sizeof(bes), size) != (int)size) if (stream.readRawData(ba.data() + sizeof(bes), size) != (int)size)
return QPixmap(); return QPixmap();
QByteArray uba = qUncompress(ba); QByteArray uba = qUncompress(ba);
if (uba.size() != tileSize.width() * tileSize.height()) if (uba.size() < tileSize.width() * tileSize.height())
return QPixmap(); return QPixmap();
QImage img((const uchar*)uba.constData(), tileSize.width(), QImage img((const uchar*)uba.constData(), tileSize.width(),
tileSize.height(), QImage::Format_Indexed8); tileSize.height(), QImage::Format_Indexed8);