summaryrefslogtreecommitdiff
path: root/wrapping/java/openjp2/org_openJpeg_OpenJPEGJavaEncoder.h
diff options
context:
space:
mode:
authorHugo Lefeuvre <hle@debian.org>2018-09-22 14:33:19 -0400
committerHugo Lefeuvre <hle@debian.org>2018-09-22 14:51:50 -0400
commitca16fe55014c57090dd97369256c7657aeb25975 (patch)
treefa3b135a1d01fa031105f728342794943ef00bf7 /wrapping/java/openjp2/org_openJpeg_OpenJPEGJavaEncoder.h
parent9d1a9dc20dd5155bab977a4f53d05c4bbd66533a (diff)
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)
Diffstat (limited to 'wrapping/java/openjp2/org_openJpeg_OpenJPEGJavaEncoder.h')
0 files changed, 0 insertions, 0 deletions