19 Commits

Author SHA1 Message Date
Ahmad Samir
e3ab850712 Add a trailing comma to enum
Should help produce better diffs and clang-format won't squash the enum
on one line.

GIT_SILENT
2021-03-08 20:14:42 +02:00
Andreas Cord-Landwehr
f4281984c1 Adapt license to LGPL-2.0-or-later
According to relicensecheck Brad is OK with changing LGPLv2 to LGPLv2+,
which is required to be compatible with the LGPL-2.1-or-later licensed
source files.
2020-07-21 09:26:47 +00:00
Martin T. H. Sandsmark
8562ce18f1 Add some sanity and bounds checking
Since QImage does sanity checking for overflows and stuff wrt.
dimensions and depth, check for QImage::isNull() as early as possible to
see if there's some funky business going on.

Also tried to add some checks wherever we wrote to "raw" memory.

Unit tests pass, and tested converting some files from
https://samples.ffmpeg.org/image-samples/ to pngs, and that seemed to
work.

Reviewed By: aacid

Differential Revision: https://phabricator.kde.org/D24367
2020-05-10 18:06:56 +02:00
Albert Astals Cid
0db5c89c5f Initialize the unread bits of _starttab
oss-fuzz #14446
2019-04-25 23:08:17 +02:00
Albert Astals Cid
9fc6967f4f Fix RGBHandler::canRead
Summary:
As one can see in SGIImage::readImage the accepted images are

    _stream >> u16;
    if (u16 != 0x01da) {
        return false;
    }

    _stream >> _rle;
    if (_rle > 1) {
        return false;
    }

so not only \x01\xda\x01 but also \x01\xda\x00

Reviewers: svuorela

Reviewed By: svuorela

Subscribers: svuorela, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20145
2019-03-31 19:44:21 +02:00
Albert Astals Cid
8e48d67568 Uncomment the qdebug includes
i've wasted enough time uncommenting and commenting them again
2019-01-31 01:37:09 +01:00
Albert Astals Cid
6dcea7fd01 rgb: Fix integer overflow in fuzzed file
oss-fuzz/12763
2019-01-29 11:19:58 +01:00
Albert Astals Cid
4751e897ce rgb: Fix Heap-buffer-overflow in fuzzed file
oss-fuzz/12757
2019-01-29 10:54:25 +01:00
Albert Astals Cid
e45b65e814 rgb: Fix crash in fuzzed image
An image without color channels makes no sense
2019-01-28 21:48:26 +01:00
Albert Astals Cid
0e21713267 rgb: fix crash in fuzzed file 2019-01-28 21:10:18 +01:00
David Faure
f485719012 kimg_rgb: optimize away QRegExp and QString::fromLocal8Bit.
Summary:
The code is even simpler this way.

Found by using heaptrack.

Test Plan: the unittest for rgb still passes.

Reviewers: cfeck

Reviewed By: cfeck

Subscribers: jtamate, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15890
2018-10-03 00:51:29 +02:00
Laurent Montel
e5b226e804 Remove not necessary QtCore and co 2018-03-11 13:49:26 +01:00
Martin Koller
7f2c44add4 Use brace-initializer instead of nullptr in returning 0-QFlags
Differential Revision: https://phabricator.kde.org/D9182
2017-12-05 19:34:30 +01:00
Kevin Funk
740fe5df0e Use nullptr everywhere
Differential Revision: https://phabricator.kde.org/D3987
2017-01-16 09:44:17 +01:00
Luca Beltrame
814c7a2b30 Partially revert d7f457a to prevent crash on application exit
The change to QLatin1String to QStringLiteral had a very nasty
unintended side effect, causing many (but not all) applications to
crash on exit.

Laurent, please be wary with blanket changes on low level code as
they might break things in unexpected ways.

CCMAIL: montel@kde.org
CCMAIL: tittiatcoke@gmail.com
2015-11-04 23:51:53 +01:00
Montel Laurent
d7f457a124 Use QStringLiteral 2015-11-02 21:57:43 +01:00
Alex Merry
c9ca1f1862 Rename headers to end with _p.h
Frameworks have a convention of naming uninstalled headers in src/ with
a _p at the end of the name, to make it clear they are not part of the
API. None of the headers in KImageFormats are installed, so it is not
really necessary to follow this convention, but we follow it anyway for
the benefit of both humans and tools (like kapidox).
2014-08-03 18:08:49 +01:00
David Faure
02b5e97197 Code reformatted using kde-dev-scripts/astyle-kdelibs.
Use git blame -w 47df948 to show authorship as it was before this commit.
2013-12-18 09:54:11 +01:00
Jenkins CI
47df9483fd Move kimageformats code to the root directory. 2013-12-18 00:45:18 +00:00