mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-02-13 05:33:00 -05:00
Compare commits
1 Commits
v6.21.0
...
work/aacid
| Author | SHA1 | Date | |
|---|---|---|---|
| 8658355701 |
@ -545,8 +545,12 @@ bool CMAPChunk::innerReadStructure(QIODevice *d)
|
|||||||
QList<QRgb> CMAPChunk::innerPalette() const
|
QList<QRgb> CMAPChunk::innerPalette() const
|
||||||
{
|
{
|
||||||
QList<QRgb> l;
|
QList<QRgb> l;
|
||||||
auto &&d = data();
|
const QByteArray &d = data();
|
||||||
for (qint32 i = 0, n = count(); i < n; ++i) {
|
const qint32 n = count();
|
||||||
|
if (n * 3 > d.size()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
for (qint32 i = 0; i < n; ++i) {
|
||||||
auto i3 = i * 3;
|
auto i3 = i * 3;
|
||||||
l << qRgb(d.at(i3), d.at(i3 + 1), d.at(i3 + 2));
|
l << qRgb(d.at(i3), d.at(i3 + 1), d.at(i3 + 2));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user