History log of /external/libjpeg-turbo/jdhuff.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6eb7d3798b5a79347c62825fc4c16f7ce673bdd0 16-Oct-2016 Alex Naidis <alex.naidis@linux.com> libjpeg-turbo: Upgrade to 1.5.1

The changes from 1.4.2 to 1.5.1 include
a big amount of fixes and huge performance improvements.
As highlights there is a full ARM 64-bit (ARMv8) NEON SIMD
implementation which improves compression of full-color JPEGs
by about 2-2.5x on average on Cortex-A53 and Cortex-A57 cores.
Also SIMD acceleration for Huffman encoding on NEON-capable
ARM 32-bit and 64-bit platforms was added.
Performance on x86/x86_64 was also improved by
adding better optimized SSE2 routines.

For the full changelog, please see the ChangeLog.md
file.

Partial decoding optimizations, the security fix
to adress b/27494207 and the fix for the AARCH64
conformance issueare present in the release.
The README.android file was edited to reflect this.

The configuration files were regenerated
and all Android specific changes were applied.

BUG:28268702

Change-Id: I538291d894df1da01d3f733771647df1fb61ec42
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
/external/libjpeg-turbo/jdhuff.c
4c0cab9a1b865a1d0b4e06b82ff5e3f64c7b30c0 05-Feb-2016 DRC <information@libjpeg-turbo.org> Prevent overread when decoding malformed JPEG

The accelerated Huffman decoder was previously invoked if there were
> 128 bytes in the input buffer. However, it is possible to construct a
JPEG image with Huffman blocks > 430 bytes in length
(http://stackoverflow.com/questions/2734678/jpeg-calculating-max-size).
While such images are pathological and could never be created by a
JPEG compressor, it is conceivable that an attacker could use such an
artifially-constructed image to trigger an input buffer overrun in the
libjpeg-turbo decompressor and thus gain access to some of the data on
the calling program's heap.

This patch simply increases the minimum buffer size for the accelerated
Huffman decoder to 512 bytes, which should (hopefully) accommodate any
possible input.

This addresses a major issue (LJT-01-005) identified in a security audit
by Cure53.

Cherry picked from upstream:
https://github.com/libjpeg-turbo/libjpeg-turbo/commit/0463f7c9aad060fcd56e98d025ce16185279e2bc

BUG:27494207
BUG:27480923

Change-Id: I94876fecafa8b7d7f31734cb21d2ca0f382802ec
/external/libjpeg-turbo/jdhuff.c
ac30a1bf12751bd82e56158eb9456a28d9c086f3 25-Jun-2015 DRC <dcommander@users.sourceforge.net> Add a new libjpeg API function (jpeg_skip_scanlines()) to allow for partially decoding a JPEG image.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1582 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
8e9cef2e6f5156c4b055a04a8f979b7291fc6b7a 21-Sep-2015 DRC <information@libjpeg-turbo.org> Fix various issues reported by the UB sanitizers
Most of these involved left shifting a negative number, which is
technically undefined (although every modern compiler I'm aware of
will implement this by treating the signed integer as a 2's complement
unsigned integer-- the LEFT_SHIFT() macro just makes this behavior
explicit in order to shut up ubsan.) This also fixes a couple of
non-issues in the entropy codecs, whereby the sanitizer reported an
out-of-bounds index in the 4th argument of jpeg_make_d_derived_tbl().
In those cases, the index was actually out of bounds (caused by a
malformed JPEG image), but jpeg_make_d_derived_tbl() would have caught
the error and aborted prior to actually using the invalid address. Here
again, the fix was to make our intentions explicit so as to shut up
ubsan.
/external/libjpeg-turbo/jdhuff.c
cf0e58de5337341000ae7f3dfec350eaaec074de 21-Jul-2015 DRC <information@libjpeg-turbo.org> Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.
2a0b4ac3372c4dbe1c710ef2d9f15b96c4c9166f 21-Jul-2015 DRC <information@libjpeg-turbo.org> Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.
944aa8e3c4ea827c57d7bb9125f39611eb67ede1 21-Jul-2015 DRC <information@libjpeg-turbo.org> Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.
/external/libjpeg-turbo/jdhuff.c
3ebcc3206f8aec0517a5840916d9249ca80f2b77 15-May-2015 DRC <dcommander@users.sourceforge.net> __WORDSIZE doesn't seem to be available on platforms other than Mac or Linux, and best practices are for user-level code not to rely on it anyhow, since it's meant to be an internal macro. Fortunately, autoconf already has a way of determining the word size at configure time, so it can be passed into the compiler. This should work on any platform and has been tested on all of the Un*x platforms we support (Linux, Mac, FreeBSD, Solaris.)


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1550 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
96869f4b6ef520bc6e0c54127f583dcc96ecd91e 30-Apr-2015 DRC <dcommander@users.sourceforge.net> Restore backward compatibility with MSVC < 2010 (broken by r1541)


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1543 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
f64b36fd5744abaca277cb01811b02067200f5ff 22-Apr-2015 DRC <dcommander@users.sourceforge.net> Oops. OS X doesn't define __WORDSIZE unless you include stdint.h, so apparently the Huffman codec hasn't ever been fully accelerated on 64-bit OS X.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1541 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
5de454b291f48382648a5d1dc2aa0fca8b5786d4 18-May-2014 DRC <dcommander@users.sourceforge.net> libjpeg-turbo has never supported non-ANSI compilers, so get rid of the crufty SIZEOF() macro. It was not being used consistently anyhow, so it would not have been possible to build prior releases of libjpeg-turbo using the broken compilers for which that macro was designed.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1313 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
b775351012af176720429ac21d11682a0b75b4b7 11-May-2014 DRC <dcommander@users.sourceforge.net> Convert tabs to spaces in the libjpeg code and the SIMD code (TurboJPEG retains the use of tabs for historical reasons. They were annoying in the libjpeg code primarily because they were not consistently used and because they were used to format as well as indent the code. In the case of TurboJPEG, tabs are used just to indent the code, so even if the editor assumes a different tab width, the code will still be readable.)


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1285 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
e5eaf37440b8e337ab150c017df7c03faf846c51 09-May-2014 DRC <dcommander@users.sourceforge.net> Convert tabs to spaces in the libjpeg code and the SIMD code (TurboJPEG retains the use of tabs for historical reasons. They were annoying in the libjpeg code primarily because they were not consistently used and because they were used to format as well as indent the code. In the case of TurboJPEG, tabs are used just to indent the code, so even if the editor assumes a different tab width, the code will still be readable.)


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1278 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
a113506d175d03ae0e40965c3d3d21a5d561e119 31-Jan-2014 DRC <dcommander@users.sourceforge.net> Some motion JPEG implementations generate "abbreviated JPEG streams" (JPEG images without the default tables included) for some or all of the video frames, in order to save space. When these are encountered, it is generally expected that they will be decompressed using the default Huffman tables, so libjpeg-turbo now does this unless the tables have been explicitly specified by an application.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1104 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
a6ef282a49f2d7d1b4d19cc89f63e81fd66b35b7 28-Sep-2013 DRC <dcommander@users.sourceforge.net> Some of the IJG headers say "Modified by", so clarify that our "Modifications" are not referring to these.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1053 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
a73e870ad02de20c2b34cb3a5382c2846c2afbe3 31-Dec-2012 DRC <dcommander@users.sourceforge.net> Change the copyright notices to make it clear that our modified files are not part of the IJG's software.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@873 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
efe28cec4b29b5a7357d9cd1c30a066486d19b12 17-Jan-2012 DRC <dcommander@users.sourceforge.net> Compiler warnings


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@734 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
bc51580f28c8ab2e45147a35aa3553f9de2c1c20 18-Apr-2011 DRC <dcommander@users.sourceforge.net> Re-factor and re-license under the libjpeg BSD-style license. Justification: the accelerated Huffman decoding optimizations in libjpeg-turbo were all developed by me as an independent developer. The structure of the inline Huffman decoding macros was originally borrowed from similar routines in the TurboJPEG/mediaLib codec, which is part of VirtualGL and TurboVNC. Thus, although the code for these macros was not copied verbatim, they were still thought to be a derivative work of TurboJPEG/mediaLib, and I assigned the copyright and license from TurboJPEG/mediaLib to them. I have re-written these routines from first principles by breaking down the libjpeg out-of-line routines. Although the new code bears algorithmic similarities to the TurboJPEG/mediaLib macros, it can now clearly be shown to be derived from the out-of-line routines and thus, in my opinion, it can no longer be considered a derivative of TurboJPEG/mediaLib. -- DRC


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@590 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
051d962318c041a907cf5ce8442d074185de7f73 16-Apr-2011 DRC <dcommander@users.sourceforge.net> The previous attempt to handle unexpected markers in the data stream caused breakage in applications that attempted to set bytes_in_buffer to a larger value than the actual size of the JPEG image. The latter behavior was causing the fast decoder to be used for the last MCU in the image under certain circumstances, and this sometimes caused the EOI marker to be encountered by the fast decoder, which was treating it as an "unexpected" marker and throwing an error. Now, the fast decoder simply hands off the decoding of the block to the slow decoder if any marker is encountered.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@584 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
df1c38df74bac01944312e6d8073d63ee48f1a0f 18-Mar-2011 DRC <dcommander@users.sourceforge.net> Throw a warning if an unexpected marker is found in the middle of the JPEG data stream


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@521 632fc199-4ca6-4c93-a231-07263d6284db
fe6a2ee5a170ddc7b2983e49fedd71cc93f52d06 18-Mar-2011 DRC <dcommander@users.sourceforge.net> Throw a warning if an unexpected marker is found in the middle of the JPEG data stream


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.0.x@524 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
fa1d18385d904d530b4aec83ab7757a33397de6e 26-Jan-2011 DRC <dcommander@users.sourceforge.net> Further protect against invalid Huffman codes


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.0.x@324 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
49aedf4231e843b9d2ef1bf5221e9c6ec7081c90 04-Jan-2011 DRC <dcommander@users.sourceforge.net> Further protect against invalid Huffman codes


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@314 632fc199-4ca6-4c93-a231-07263d6284db
49967cdb30edd0479a1719eedc1dace5ba078d3f 09-Oct-2010 DRC <dcommander@users.sourceforge.net> Improve readability and flexibility of compatibility macros


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@241 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
36a6eec93250e390d1028b3372078810b4428eaf 08-Oct-2010 DRC <dcommander@users.sourceforge.net> Added optional emulation of the jpeg-7 or jpeg-8b API/ABI's


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@236 632fc199-4ca6-4c93-a231-07263d6284db
989630f70cf1af69ebfefca8910d1647bf189712 10-Jan-2010 Guido Vollbeding <jpeg-info@uc.ag> The Independent JPEG Group's JPEG software v8
/external/libjpeg-turbo/jdhuff.c
5996a25e2f50d20d6a8f09830724035b49c3927b 27-Jun-2009 Guido Vollbeding <jpeg-info@jpegclub.org> The Independent JPEG Group's JPEG software v7
/external/libjpeg-turbo/jdhuff.c
5ead57a34a398aa798f35bd7a6abad19b2e453e2 27-Mar-1998 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v6b
/external/libjpeg-turbo/jdhuff.c
489583f5165e05d37302e8eeec58104ea0109127 07-Feb-1996 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v6a
/external/libjpeg-turbo/jdhuff.c
bc79e0680a45d1ca330d690dae0340c8e17ab5e3 02-Aug-1995 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v6
/external/libjpeg-turbo/jdhuff.c
a8b67c4fbbfde9b4b4e03f2dea8f4f0b1900fc33 15-Mar-1995 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v5b
/external/libjpeg-turbo/jdhuff.c
36a4ccccd33f5cc9df62949554af87129ced7f84 24-Sep-1994 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v5
/external/libjpeg-turbo/jdhuff.c
cc7150e281999ac2642e21f13e2c160f68b1d675 18-Feb-1993 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v4a
/external/libjpeg-turbo/jdhuff.c
88aeed428fd820659e3ae00292cb84ecfc05dd23 10-Dec-1992 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v4
/external/libjpeg-turbo/jdhuff.c
4a6b7303643714d495b9d26742d8a156fd120936 17-Mar-1992 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v3
/external/libjpeg-turbo/jdhuff.c
bd543f030e7e435c2c6a6a7d52ad927ae97cd927 13-Dec-1991 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v2
/external/libjpeg-turbo/jdhuff.c
2cbeb8abd92d5ad8a1bd415b51b3816213b15f31 07-Oct-1991 Thomas G. Lane <tgl@netcom.com> The Independent JPEG Group's JPEG software v1
/external/libjpeg-turbo/jdhuff.c
0fbb28ec39f9f9bd6f665a9cc6c8ad6a7b033b89 30-Jul-2010 DRC <dcommander@users.sourceforge.net> Handle erroneous Huffman codes


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@221 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
830d5fccf4c0fe37299c9244e3e7bee3ab4e226b 20-Apr-2010 DRC <dcommander@users.sourceforge.net> Use 64-bit holding buffer on Win64 for increased performance


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@177 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
97f8ec4b601d80a5e1e3fb57d8393f44f47d0a11 20-Mar-2010 DRC <dcommander@users.sourceforge.net> I'm not sure why, but this was necessary in order to return the 32-bit performance to the 0.0.90 baseline


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@165 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
e885a8bf41656a829d29832c22915902ca738871 15-Mar-2010 DRC <dcommander@users.sourceforge.net> Fix data corruption issues when decompressing large JPEG images and/or using buffered I/O. Specifically, decode_mcu_fast() can potentially process more than 1 MCU, so make sure there is enough space in the buffer to accommodate this case. Otherwise, the buffer pointer goes negative, and bad mojo ensues. Also, the fast decoder's method of handling unread markers doesn't make libjpeg's restart handler happy, so disable fast decode when restarts are used.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@162 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c
e2816648d8744343896a7044b35a8f082447dc43 28-Sep-2009 DRC <dcommander@users.sourceforge.net> Greatly improve performance of Huffman decoding


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@64 632fc199-4ca6-4c93-a231-07263d6284db
/external/libjpeg-turbo/jdhuff.c