From d79c11d280ca70f9c32cfa5f80403b66949725f6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 22:57:33 +0100 Subject: [PATCH] ras: tweak max file check better to do - 32 than + 32 otherwise we may overflow oss-fuzz/13017 --- src/imageformats/ras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imageformats/ras.cpp b/src/imageformats/ras.cpp index 0e530b5..f1279e1 100644 --- a/src/imageformats/ras.cpp +++ b/src/imageformats/ras.cpp @@ -122,7 +122,7 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img) return false; } // QVector uses some extra space for stuff, hence the 32 here suggested by thiago - if (ras.Length + 32 > std::numeric_limits::max()) { + if (ras.Length > std::numeric_limits::max() - 32) { qWarning() << "LoadRAS() unsupported image length in file header" << ras.Length; return false; }