mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-02-21 23:43:03 -05:00
Check device before read
This commit is contained in:
committed by
Mirco Miranda
parent
aeb2988eec
commit
e8e5b091bc
@ -160,7 +160,7 @@ static bool LoadQOI(QIODevice *device, const QoiHeader &qoi, QImage &img)
|
|||||||
// Handle the byte stream
|
// Handle the byte stream
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
for (quint32 y = 0, run = 0; y < qoi.Height; ++y) {
|
for (quint32 y = 0, run = 0; y < qoi.Height; ++y) {
|
||||||
if (quint64(ba.size()) < px_len) {
|
if (quint64(ba.size()) < px_len && !device->atEnd()) {
|
||||||
ba.append(device->read(px_len));
|
ba.append(device->read(px_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user