diff options
author | Jonathan Wright <jonathan.wright@arm.com> | 2020-08-05 11:42:22 +0100 |
---|---|---|
committer | Jonathan Wright <jonathan.wright@arm.com> | 2020-08-07 17:04:34 +0100 |
commit | db870dfef8ab97950b4bdf22c66dd6c18326460b (patch) | |
tree | 9862c1aa45d014815ec798992ecb43eff1bc8d42 /wrbmp.c | |
parent | 341272d909285da90e44015ca41f956fd00b9dd8 (diff) |
Update libjpeg-turbo to v2.0.5
Update Chromium's copy of libjpeg-turbo to the latest stable upstream
release (v2.0.5) and reapply our local changes documented in
README.chromium. This update addresses three CVEs - CVE-2018-19664,
CVE-2018-20330, CVE-2018-20330 - that do not affect Chromium. The
fixes do, however, satisfy UBSan - allowing Chromium's libjpeg-turbo
to be used in AOSP.
Cherry-pick one additional change[1] from upstream to prevent AArch64
Windows builds from failing.
[1] https://github.com/libjpeg-turbo/libjpeg-turbo/commit/6ee5d5f568fda1a7c6a49dd8995f2d89866ee42d
Bug: 922430
Bug: https://issuetracker.google.com/135180511
Change-Id: I146fe82f7a016ce393eb0d37aebe0b7c2492a9da
Diffstat (limited to 'wrbmp.c')
-rw-r--r-- | wrbmp.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -5,7 +5,7 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014-2015, 2017, D. R. Commander. + * Copyright (C) 2014-2015, 2017, 2019, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -303,9 +303,7 @@ write_os2_header(j_decompress_ptr cinfo, bmp_dest_ptr dest) int bits_per_pixel, cmap_entries; /* Compute colormap size and total file size */ - if (cinfo->out_color_space == JCS_RGB || - (cinfo->out_color_space >= JCS_EXT_RGB && - cinfo->out_color_space <= JCS_EXT_ARGB)) { + if (IsExtRGB(cinfo->out_color_space)) { if (cinfo->quantize_colors) { /* Colormapped RGB */ bits_per_pixel = 8; @@ -499,15 +497,14 @@ jinit_write_bmp(j_decompress_ptr cinfo, boolean is_os2, if (cinfo->out_color_space == JCS_GRAYSCALE) { dest->pub.put_pixel_rows = put_gray_rows; - } else if (cinfo->out_color_space == JCS_RGB || - (cinfo->out_color_space >= JCS_EXT_RGB && - cinfo->out_color_space <= JCS_EXT_ARGB)) { + } else if (IsExtRGB(cinfo->out_color_space)) { if (cinfo->quantize_colors) dest->pub.put_pixel_rows = put_gray_rows; else dest->pub.put_pixel_rows = put_pixel_rows; - } else if (cinfo->out_color_space == JCS_RGB565 || - cinfo->out_color_space == JCS_CMYK) { + } else if (!cinfo->quantize_colors && + (cinfo->out_color_space == JCS_RGB565 || + cinfo->out_color_space == JCS_CMYK)) { dest->pub.put_pixel_rows = put_pixel_rows; } else { ERREXIT(cinfo, JERR_BMP_COLORSPACE); |