diff --git a/src/imageformats/ras.cpp b/src/imageformats/ras.cpp index 15f8017..2d0e5a4 100644 --- a/src/imageformats/ras.cpp +++ b/src/imageformats/ras.cpp @@ -143,7 +143,7 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img) QVector 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))) {