mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-06-12 18:39:10 -04:00
IFF: fix byte swapping in 16-bit DEEP images
This commit is contained in:
@@ -4069,8 +4069,19 @@ QByteArray DBODChunk::strideRead(QIODevice *d, qint32, const DGBLChunk *header,
|
||||
}
|
||||
|
||||
// Uncompressed, Rle and TvDeepCompression: one line at a time.
|
||||
if (rr != size)
|
||||
if (rr != size) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// byte swap
|
||||
if (auto count = pel->count()) {
|
||||
if (pel->depth() / count == 16) {
|
||||
for (auto x = 0, w = qint32(planes.size()) - 1; x < w; x += 2) {
|
||||
std::swap(planes[x], planes[x + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return planes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user