summaryrefslogtreecommitdiff
path: root/rdppm.c
diff options
context:
space:
mode:
authorJonathan Wright <jonathan.wright@arm.com>2020-11-25 13:36:43 +0000
committerJonathan Wright <jonathan.wright@arm.com>2020-11-30 12:08:32 +0000
commitbbb828223e9c8f83f0e84db1e98b116029e62765 (patch)
treed2467975e2bf1442216d2c779054102ee37f599c /rdppm.c
parentd5148db386ceb4a608058320071cbed890bd6ad2 (diff)
Update libjpeg-turbo to v2.0.90 (2.1 beta1)
Update Chromium's copy of libjpeg-turbo to the latest upstream release (v2.0.90) and re-apply our local changes documented in README.chromium. Cherry-pick two additional changes from upstream to fix bugs found by fuzzers: 1) https://github.com/libjpeg-turbo/libjpeg-turbo/commit/ccaba5d7894ecfb5a8f11e48d3f86e1f14d5a469 2) https://github.com/libjpeg-turbo/libjpeg-turbo/commit/c7ca521bc85b57d41d3ad4963c13fc0100481084 Significant changes provided by this update: 1) A large performance boost to JPEG encoding due to an improved Huffman encoding implementation. 2) The complete removal of Arm Neon assembly code. This allows Arm's control-flow integrity security features (Armv8.3-A Pointer Authentication and Armv8.5-A Branch Target Identification) to be switched on with the appropriate compiler flags. Bug: 922430 Bug: b/135180511 Bug: 919548, 1145581 Change-Id: I319fcdc55b3fd5b219425c07a4e4a03587f4e06d
Diffstat (limited to 'rdppm.c')
-rw-r--r--rdppm.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/rdppm.c b/rdppm.c
index a8507b9..c4c937e 100644
--- a/rdppm.c
+++ b/rdppm.c
@@ -43,18 +43,8 @@
/* Macros to deal with unsigned chars as efficiently as compiler allows */
-#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char U_CHAR;
#define UCH(x) ((int)(x))
-#else /* !HAVE_UNSIGNED_CHAR */
-#ifdef __CHAR_UNSIGNED__
-typedef char U_CHAR;
-#define UCH(x) ((int)(x))
-#else
-typedef char U_CHAR;
-#define UCH(x) ((int)(x) & 0xFF)
-#endif
-#endif /* HAVE_UNSIGNED_CHAR */
#define ReadOK(file, buffer, len) \
@@ -659,11 +649,12 @@ start_input_ppm(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
if (maxval > 255) {
source->pub.get_pixel_rows = get_word_rgb_row;
} else if (maxval == MAXJSAMPLE && sizeof(JSAMPLE) == sizeof(U_CHAR) &&
- (cinfo->in_color_space == JCS_EXT_RGB
#if RGB_RED == 0 && RGB_GREEN == 1 && RGB_BLUE == 2 && RGB_PIXELSIZE == 3
- || cinfo->in_color_space == JCS_RGB
+ (cinfo->in_color_space == JCS_EXT_RGB ||
+ cinfo->in_color_space == JCS_RGB)) {
+#else
+ cinfo->in_color_space == JCS_EXT_RGB) {
#endif
- )) {
source->pub.get_pixel_rows = get_raw_row;
use_raw_buffer = TRUE;
need_rescale = FALSE;