openjpeg/src/bin
Hugo Lefeuvre ca16fe5501 convertbmp: fix issues with zero bitmasks
In the case where a BMP file declares compression 3 (BI_BITFIELDS)
with header size <= 56, all bitmask values keep their initialization
value 0. This may lead to various undefined behavior later e.g. when
doing 1 << (l_comp->prec - 1).

This issue does not affect files with bit count 16 because of a check
added in 16240e2 which sets default values to the color masks if they
are all 0.

This commit adds similar checks for the 32 bit case.

Also, if a BMP file declares compression 3 with header size >= 56 and
intentional 0 bitmasks, the same issue will be triggered in both the
16 and 32 bit count case.

This commit adds checks to bmp_read_info_header() rejecting BMP files
with "intentional" 0 bitmasks. These checks might be removed in the
future when proper handling of zero bitmasks will be available in
openjpeg2.

fixes #1057 (CVE-2018-5785)
2018-09-22 14:51:50 -04:00
..
common opj_getopt.c: avoid crash on invalid input (#301) 2017-09-03 00:30:36 +02:00
jp2 convertbmp: fix issues with zero bitmasks 2018-09-22 14:51:50 -04:00
jp3d jp3d: Replace sprintf() by snprintf() in volumetobin() 2018-03-03 10:11:39 +01:00
jpip Reformat whole codebase with astyle.options (#128) 2017-05-09 20:46:20 +02:00
jpwl Add missing fclose() statement in error condition. 2017-10-20 15:31:45 -04:00
mj2 Merge pull request #1094 from kbabioch/fix/missing-format-string-parameter 2018-03-04 23:16:04 +01:00
wx Spelling fixes (patch by ka7, #890, rebased on top of master) 2017-07-26 21:06:38 +02:00
CMakeLists.txt [trunk] FolderReorgProposal task: fix JPWL 2012-09-28 09:26:51 +00:00