mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Check the image data size
This commit is contained in:
parent
c0e2597dcc
commit
2c770d3756
@ -654,6 +654,7 @@ static quint32 readSymbol(DataStream &stream, QPixmap &pixmap)
|
||||
ds += paletteSize * 4;
|
||||
}
|
||||
|
||||
if (imageSize >= lineSize * height) {
|
||||
if (paletteSize) {
|
||||
img = QImage((uchar*)data.data(), width, height, lineSize,
|
||||
QImage::Format_Indexed8);
|
||||
@ -661,6 +662,7 @@ static quint32 readSymbol(DataStream &stream, QPixmap &pixmap)
|
||||
} else
|
||||
img = QImage((uchar*)data.data(), width, height, lineSize,
|
||||
QImage::Format_RGBX8888).rgbSwapped();
|
||||
}
|
||||
pixmap = QPixmap::fromImage(img);
|
||||
|
||||
/* There should be no more data left in the record, but broken GPI files
|
||||
|
Loading…
Reference in New Issue
Block a user