mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-11-17 16:52:45 -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
|
||||
QByteArray ba;
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user