mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
ras: Don't overread input on malformed files
This commit is contained in:
parent
aaa285a3b9
commit
645daec1ef
@ -143,7 +143,7 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img)
|
||||
QVector<quint8> input(ras.Length);
|
||||
|
||||
int i = 0;
|
||||
while (! s.atEnd()) {
|
||||
while (! s.atEnd() && i < input.size()) {
|
||||
s >> input[i];
|
||||
// I guess we need to find out if we're at the end of a line
|
||||
if (paddingrequired && i != 0 && !(i % (ras.Width * bpp))) {
|
||||
|
Loading…
Reference in New Issue
Block a user