mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-09-26 21:14:19 -04:00
ras: Don't overread input on malformed files
This commit is contained in:
@ -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))) {
|
||||||
|
Reference in New Issue
Block a user