summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qbmphandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-7/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| * Really fix crash on certain malformed bmp imagesEirik Aavitsland2016-05-251-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | This is an improvement of e4f71b0c. By using the QImageReader::read() overload taking a QImage pointer, and ignoring the return value, one could still end up with a corrupt QImage object. Avoid the subsequent crashes by closing that hole. Change-Id: I5dca10e4808ac3365e3ddba6689edecb7444948f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Crash fix: reject certain malformed bmp imagesEirik Aavitsland2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | A malformed bmp file header could specify a negative color table size. The bmp handler would then return a QImage that claimed to be valid, but actually was invalid, having an empty color table. This would cause crash later, e.g. when attempting to paint it. Change-Id: I7df7c40867557a82dbcee44c7de061226ff232c0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix regression in reading certain compressed bmp imagesAndy Shaw2015-08-201-3/+3
| | | | | | | | | | | | | For BITFIELDS compressed images, the image data may be preceded by bitmask fields. The file positioning code that should make sure those were read correctly was erroneously included in the block of code that was moved in 6f1b82fccdaf202856dcc6510c16b0531680fe23. Task-number: QTBUG-45559 Task-number: QTBUG-40890 Done-with: Eirik Aavitsland Change-Id: Id2b3ce078f67ac6ebf75ab0cc463dc719af83393 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-6/+7
|\ | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| * Fixes crash in bmp and ico image decodingEirik Aavitsland2015-03-131-6/+7
| | | | | | | | | | | | | | | | Fuzzing test revealed that for certain malformed bmp and ico files, the handler would segfault. Change-Id: I19d45145f31e7f808f7f6a1a1610270ea4159cbe Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QtGui: Fix const correctness in old style castsThiago Macieira2015-03-121-1/+1
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Fix a division by zero when processing malformed BMP files.Richard J. Moore2015-02-241-0/+8
| | | | | | | | | | | | | | | | | | | | This fixes a division by 0 when processing a maliciously crafted BMP file. No impact beyond DoS. Task-number: QTBUG-44547 Change-Id: Ifcded2c0aa712e90d23e6b3969af0ec3add53973 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-39/+22
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Clean up QImage::Format switchesAllan Sandfeld Jensen2014-09-251-20/+11
| | | | | | | | | | | | | | | | | | | | Changes some switches on QImage::Format that needed to be updated whenever a new image format was added. Two were changed to matching formats supported by BMP and PPM instead of what they don't support, and two were changed to now use QPixelFormat values. Change-Id: I5a14f1d7b7cc0451c68e4d6ab2361a5bd8dc8915 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-0/+4
|/ | | | | | | | | | | | Extend the QImage format with two 8-bit grayscale and alpha formats. These formats have the advantage over Indexed8 that they have simpler conversion and can be rendered to by the raster engine. [ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit formats which can also be rendered to. Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QImage support for RGB30 formatsAllan Sandfeld Jensen2014-07-041-0/+4
| | | | | | | | | | | | | | Adds basic support for 10-bit per color channel formats to QImage and the XCB plugin. This will make it possible to paint to and from these formats, but only at 8-bit per color channel accuracy. This also fixes Qt5 applications on X11 with native 30bit depth. [ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats. Task-number: QTBUG-25998 Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fixes: 32 bit and alpha bmp format image readingaavit2014-01-081-46/+61
| | | | | | | | | | | | | | | | | The bmp handler would ignore the high byte of a 32bit bmp. It would also ignore any alpha channel. The actual change is really simple; it just adds the alpha_* members and the reading of the 4th byte in 32bit depth. However, detection of alpha channel required switching the order of two independent blocks of code, hence the size of this patch. [ChangeLog][QtGui] Support reading bmp images with alpha channel Task-number: QTBUG-35220 Change-Id: Ib133c3644c03c5cfc728f5fa2c837219804e69ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Support RGBA image formatAllan Sandfeld Jensen2013-07-231-0/+3
| | | | | | | | | Support the byte-ordered RGBA format which is used by OpenGL, and many endian neutral byte formats. Task-number: QTBUG-32201 Change-Id: I77cffb4c30c69545fa96ded2f537b2ebd9351acb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Remove use of 'register' from Qt.Stephen Kelly2013-06-171-6/+6
| | | | | | | | | | It is deprecated and clang is starting to warn about it. Patch mostly generated by clang itself, with some careful grep and sed for the platform-specific parts. Change-Id: I8058e6db0f1b41b33a9e8f17a712739159982450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed crash in image reader when reading certain BMP files.Samuel Rødal2013-02-061-4/+4
| | | | | | | | | | | | | | | If the high bit in a mask is set, for instance if the mask is 0xff000000, and we shift it to the right by 24 positions, since the mask was not declared as unsigned we ended up with a mask value of 0xffffffff. We then add 1 to this value and divide by the result, causing a division by zero crash. The masks need to be declared unsigned to prevent sign bit extension when shifting right. Task-number: QTBUG-29194 Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix DIB image reading.Friedemann Kleint2012-10-021-1/+4
| | | | | | | | | Position the QIODevice correctly for DIB (==BMP without file header). Task-number: QTBUG-26690 Change-Id: I7922b4e830a92dcc19f1b52e305ca9ff3fd5d9f5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Avoid unnecessary detach when saving to BMP.Kim Motoyoshi Kalland2012-06-211-5/+5
| | | | | | | Task-number: QTBUG-11486 Change-Id: Ic9aa733da4f23dc3eaba111c97a39bfd911f8cb3 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Removed invalid assert in BMP loader code.Kim Motoyoshi Kalland2012-03-141-2/+0
| | | | | | | Task-number: QTBUG-24505 Change-Id: I2e369b6d92f072caadeda41125303856ddfabd48 Reviewed-by: aavit <qt_aavit@ovi.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Q_WS_ and Q_OS_SYMBIAN from QtGui.Friedemann Kleint2011-10-131-15/+0
| | | | | | Change-Id: I2ac3376513c3fbfc81a2e695a73a0d948d2696bc Reviewed-on: http://codereview.qt-project.org/6607 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-08-031-9/+55
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_x11.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlinecontrol_p.h src/gui/widgets/qtabwidget.h Change-Id: I90ba893a5553b9ff5658ca0a3221ecf76be4c736
| * Add initial support for bitmap version 4/5 headers.Ilya Konkov2011-07-251-9/+55
| | | | | | | | | | | | | | | | | | | | The headers are just skipped, information stored in them is ignored. Merge-request: 824 Change-Id: I48f37757114ed83cd5c92cb3d5a43eeaca4b91b3 Reviewed-on: http://codereview.qt.nokia.com/2108 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* | Images: Implement internal DIB image plugin.Friedemann Kleint2011-07-191-6/+17
|/ | | | | | | | | | | For use for clipboard/DnD operations on Windows by its Lighthouse plugin (to prevent having to export qt_read_dib(), qt_write_dib()). Change-Id: I79e69bf7cecb16cc47ea29de6805fc52e4df1007 Reviewed-on: http://codereview.qt.nokia.com/1714 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+837
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12