mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 00:58:15 -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);
|
QVector<quint8> input(ras.Length);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (! s.atEnd()) {
|
while (! s.atEnd() && i < input.size()) {
|
||||||
s >> input[i];
|
s >> input[i];
|
||||||
// I guess we need to find out if we're at the end of a line
|
// I guess we need to find out if we're at the end of a line
|
||||||
if (paddingrequired && i != 0 && !(i % (ras.Width * bpp))) {
|
if (paddingrequired && i != 0 && !(i % (ras.Width * bpp))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user