psd: Don't abort on broken images

oss-fuzz/46418
This commit is contained in:
Albert Astals Cid
2022-04-06 00:35:02 +02:00
parent 84d56d00cf
commit 5c47a97b79
3 changed files with 22 additions and 4 deletions

10
src/imageformats/util_p.h Normal file
View File

@ -0,0 +1,10 @@
/*
SPDX-FileCopyrightText: 2022 Albert Astals Cid <aacid@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include <limits>
// QVector uses some extra space for stuff, hence the 32 here suggested by Thiago Macieira
static constexpr int kMaxQVectorSize = std::numeric_limits<int>::max() - 32;