summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/gif/qgifhandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Port from container.count()/length() to size()Marc Mutz2022-10-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-43/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add logging categories to image handlersAllan Sandfeld Jensen2020-09-301-1/+4
| | | | | Change-Id: Ia0c47826d08b3f641c17d8a585f62d008a8b095b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Gif decoder: fix read error caused by ub checkEirik Aavitsland2020-09-181-5/+7
| | | | | | | | | | | The recently added check to avoid negative-bitshift ub ignored that the algorithm will sometimes use a negative bitcount value as a flag. This caused reading failure for some frames. Pick-to: 5.15 5.12 Fixes: QTBUG-86702 Change-Id: I4c247a7eb6102f9b51cc8ac708c60db80d609e38 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix gif parsing error for large imagesTang HaiXiang2020-07-141-2/+2
| | | | | | | | | | | | | | A very large GIF image resulted in cropping of image updates, due to the handler trying to protect against very large values. Increase that size from 200 to 16384, which is also the value used in the withinSizeLimit method. Fixes: QTBUG-85340 Pick-to: 5.15 Change-Id: I70888d76b378ee4f49694e90d7d753fae817ff2a Reviewed-by: Lu YaNing <luyaning@uniontech.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in pluginsJarek Kobus2020-07-061-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QImageIO: use the new allocation checker in the format handlersEirik Aavitsland2020-06-261-5/+7
| | | | | | Change-Id: I604d99ce476d4758a1e20b78257082911f1f1546 Task-number: QTBUG-85037 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Gif decoder: Harden handling of corrupt filesEirik Aavitsland2020-06-091-2/+5
| | | | | | | | Fix potential UB for corrupt files. Pick-to: 5.15 5.12 Change-Id: If5d1b859a03b09e3479a6a7adaaf3432958126b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* gif image handler: check for out of range image sizeEirik Aavitsland2020-05-301-0/+13
| | | | | | | | | Make the decoder fail early to avoid spending time and memory on attempting to decode a corrupt image file. Pick-to: 5.15 5.12 5.9 Change-Id: Ic556d4fbcb6b542fc110d10e48dac1a880e60697 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Gif decoder: avoid undefined values in enumEirik Aavitsland2020-05-301-1/+2
| | | | | | | | | The gif standard allocates 3 bits for the disposal method, but values 4-7 are unused. Pick-to: 5.15 5.12 Change-Id: I0f70b3f87b4cd8e98140c3da476702a22ebe93a9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-041-7/+0
|\ | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * Remove overrides of QImageIOHandler::name()Shawn Rutledge2020-03-031-7/+0
| | | | | | | | | | | | | | | | | | We will remove the virtual base class function in Qt 6. For now, name() returns format(). Change-Id: I1597e823b859e4db148b3e5ac0f1c15350a582eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Make bytes-per-line safe for int overflowAllan Sandfeld Jensen2020-02-201-2/+2
|/ | | | | | | | Goes through the Qt code and make sure bytes-per-line calculations are safe when they are too big for 32bit integers. Change-Id: I88b2d74b3da82e91407d316aa932a4a37587c0cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-6/+6
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compilation with disabled deprecated APIsSona Kurazyan2019-07-081-0/+2
| | | | | | | | | | | The QImageIOHandler::name() has been deprecated since 5.13, but its overrides weren't. Enabled compilation of the overrides only when the QImageIOHandler::name() is compiled. Task-number: QTBUG-76491 Change-Id: I8fea0032427d25bb0de01be8920c723fc21f6b7a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix memory copy in QGIFFormat::disposePrevious()Andrew Smolko2018-11-061-2/+2
| | | | | | | | Fix invalid destination address in memcpy operation when RestoreImage disposal method is used. Task-number: QTBUG-71599 Change-Id: Ib74a044c0e45250ff708268c463f831ee54933e6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Check for QImage allocation failure in qgifhandlerEirik Aavitsland2018-08-061-1/+6
| | | | | | | | Since image files easily can be (or corrupt files claim to be) huge, it is worth checking for out of memory situations. Change-Id: I635a3ec6852288079fdec4e14cf7e776fe59e9e0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow QImage with more than 2GByte of image dataAllan Sandfeld Jensen2017-07-081-2/+2
| | | | | | | | | | | | Changes internal data-size and pointer calculations to qssize_t. Adds new sizeInBytes() accessor to read byte size, and marks the old one deprecated. Task-number: QTBUG-50912 Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
* Always build JPEG and GIF support as pluginsLars Knoll2016-04-071-0/+1218
Our handling of plugins when Qt is build statically is nowadays good enough, so we don't need to build the JPEG and GIF support directly into Qt for static builds. Let's simply always build them as plugins. Also simplify the logic in configure, and get rid of the no-gif, no-jpeg and no-png config variables. [ChangelLog][Build system] JPEG and GIF image support is now always built as a plugin. Removed -imageformat-[jpeg|gif] arguments to configure. Change-Id: Ic01559ff406c966807b3be8761252e8802adcdf7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>