summaryrefslogtreecommitdiff
path: root/jdatadst-tj.c
diff options
context:
space:
mode:
authorJonathan Wright <jonathan.wright@arm.com>2020-08-05 11:42:22 +0100
committerJonathan Wright <jonathan.wright@arm.com>2020-08-07 17:04:34 +0100
commitdb870dfef8ab97950b4bdf22c66dd6c18326460b (patch)
tree9862c1aa45d014815ec798992ecb43eff1bc8d42 /jdatadst-tj.c
parent341272d909285da90e44015ca41f956fd00b9dd8 (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 'jdatadst-tj.c')
-rw-r--r--jdatadst-tj.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/jdatadst-tj.c b/jdatadst-tj.c
index 0bd961b..fdaa2de 100644
--- a/jdatadst-tj.c
+++ b/jdatadst-tj.c
@@ -5,7 +5,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2012 by Guido Vollbeding.
* libjpeg-turbo Modifications:
- * Copyright (C) 2011, 2014, 2016, D. R. Commander.
+ * Copyright (C) 2011, 2014, 2016, 2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -27,6 +27,8 @@
extern void *malloc(size_t size);
extern void free(void *ptr);
#endif
+void jpeg_mem_dest_tj(j_compress_ptr cinfo, unsigned char **outbuffer,
+ unsigned long *outsize, boolean alloc);
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
@@ -101,8 +103,7 @@ empty_mem_output_buffer(j_compress_ptr cinfo)
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
- if (dest->newbuffer != NULL)
- free(dest->newbuffer);
+ free(dest->newbuffer);
dest->newbuffer = nextbuffer;