aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-21Merge "Ensure that default Huffman tables are initialized" into nyc-devandroid-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-cts-7.0_r9android-cts-7.0_r8android-cts-7.0_r7android-cts-7.0_r6android-cts-7.0_r5android-cts-7.0_r4android-cts-7.0_r33android-cts-7.0_r32android-cts-7.0_r31android-cts-7.0_r30android-cts-7.0_r3android-cts-7.0_r29android-cts-7.0_r28android-cts-7.0_r27android-cts-7.0_r26android-cts-7.0_r25android-cts-7.0_r24android-cts-7.0_r23android-cts-7.0_r22android-cts-7.0_r21android-cts-7.0_r20android-cts-7.0_r2android-cts-7.0_r19android-cts-7.0_r18android-cts-7.0_r17android-cts-7.0_r16android-cts-7.0_r15android-cts-7.0_r14android-cts-7.0_r13android-cts-7.0_r12android-cts-7.0_r11android-cts-7.0_r10android-cts-7.0_r1android-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r61android-7.1.1_r60android-7.1.1_r6android-7.1.1_r59android-7.1.1_r58android-7.1.1_r57android-7.1.1_r56android-7.1.1_r55android-7.1.1_r54android-7.1.1_r53android-7.1.1_r52android-7.1.1_r51android-7.1.1_r50android-7.1.1_r49android-7.1.1_r48android-7.1.1_r47android-7.1.1_r46android-7.1.1_r45android-7.1.1_r44android-7.1.1_r43android-7.1.1_r42android-7.1.1_r41android-7.1.1_r40android-7.1.1_r4android-7.1.1_r39android-7.1.1_r38android-7.1.1_r35android-7.1.1_r33android-7.1.1_r32android-7.1.1_r31android-7.1.1_r3android-7.1.1_r28android-7.1.1_r27android-7.1.1_r26android-7.1.1_r25android-7.1.1_r24android-7.1.1_r23android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1android-7.0.0_r9android-7.0.0_r8android-7.0.0_r7android-7.0.0_r6android-7.0.0_r5android-7.0.0_r4android-7.0.0_r36android-7.0.0_r35android-7.0.0_r34android-7.0.0_r33android-7.0.0_r32android-7.0.0_r31android-7.0.0_r30android-7.0.0_r3android-7.0.0_r29android-7.0.0_r28android-7.0.0_r27android-7.0.0_r24android-7.0.0_r21android-7.0.0_r19android-7.0.0_r17android-7.0.0_r15android-7.0.0_r14android-7.0.0_r13android-7.0.0_r12android-7.0.0_r11android-7.0.0_r10android-7.0.0_r1nougat-releasenougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devnougat-mr1.8-releasenougat-mr1.7-releasenougat-mr1.6-releasenougat-mr1.5-releasenougat-mr1.4-releasenougat-mr1.3-releasenougat-mr1.2-releasenougat-mr1.1-releasenougat-mr1-volantis-releasenougat-mr1-security-releasenougat-mr1-releasenougat-mr1-flounder-releasenougat-mr1-devnougat-mr1-cts-releasenougat-mr0.5-releasenougat-dr1-releasenougat-devnougat-cts-releasenougat-bugfix-releaseMatt Sarett
2016-03-17Prevent overread when decoding malformed JPEGDRC
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
2016-03-17Ensure that default Huffman tables are initializedDRC
This prevents a malformed motion-JPEG frame (MJPEG frames lack Huffman tables) from causing the "fast path" of the Huffman decoder to read uninitialized memory. Essentially, this is doing the same thing for MJPEG frames as 43d8cf4d4572fa50a37cccadbe71b9bee37de55d did for regular images. Cherry picked from upstream: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/a572622dd654305c86585724c2a1ea34e22c2103 BUG:27494207 BUG:27480923 Change-Id: I91f334b82290b009bc624b3d5f8a9b3021f34ea0
2016-02-22libjpeg API: Partial scanline decompressionDRC
This, in combination with the existing jpeg_skip_scanlines() function, provides the ability to crop the image both horizontally and vertically while decompressing (certain restrictions apply-- see libjpeg.txt.) This also cleans up the documentation of the line skipping feature and removes the "strip decompression" feature from djpeg, since the new cropping feature is a superset of it. Refer to #34 for discussion. Closes #34 Cherry picked from upstream: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/3ab68cf563f6edc2608c085f5c8b2d5d5c61157e BUG:27290496 Change-Id: Id11312fa43959531bc6bea04ebb657c6e1140363
2016-01-21Compile x86 and x86-64 assembly with appropriate compiler flagsMatt Sarett
This provides ~2.5x speed-up on full image decodes. BUG:25815224 BUG:25641008 Change-Id: I3ce188d371c5e41ebc810dbc810ac460be3b5074
2016-01-11Remove unused warnings from libjpeg-turboChris Craik
Change-Id: I78a73665923db7200aaff7c5a9c0da8f7ac4a58e
2015-12-16Merge "Use the clang integrated assembler for Arm64 assembly code"Matt Sarett
2015-12-16Remove unnecessary .arch directive in ARM64 codeDRC
This directive was preventing the code from assembling using the integrated assembler in clang. Fixes Upstream-Issue-33 https://github.com/libjpeg-turbo/libjpeg-turbo/issues/33 https://github.com/libjpeg-turbo/libjpeg-turbo/commit/d70a5c12fcb72443483456a2cc8dd18a4c238618 Change-Id: I9e361d509be759cd45ed8d8061f939059ad5fe4a
2015-12-15Use the clang integrated assembler for Arm64 assembly codeMatt Sarett
We have cherry-picked a fix from upstream so that the assembly is now clang compatible. BUG:25564571 Change-Id: Ic4a676b8648e5bc83e3a1da1f346ec2f5cc953ac
2015-12-04Turn off x86 and x86-64 SIMDMatt Sarett
This is a workaround for https://buganizer.corp.google.com/u/0/issues/26023491 libjpeg.so has text relocations. BUG:26023491 Change-Id: I54cf63479a23fe5cbf2ecce97781cbb1110a46b3
2015-12-03Merge "Change library module name to libjpeg"Matt Sarett
2015-12-03Fix build breakages on ariel by always building with clangMatt Sarett
Change-Id: I9422d03fbde8061619c52f4202fd0fa7dd12fe5a
2015-12-01Add Owners information for VOMITMatt Sarett
BUG:25685061 Change-Id: I7a7710ed7d1320fac2062d83eba4a230de92e10c
2015-11-30Merge "Fix x86 and x86_64 builds by specifying LOCAL_C_INCLUDES"Matt Sarett
2015-11-30Fix x86 and x86_64 builds by specifying LOCAL_C_INCLUDESMatt Sarett
I must have accidentally dropped this line from the previous commit: https://googleplex-android-review.git.corp.google.com/#/c/818568/ Change-Id: I0c19a01bdd588a88e13acfdea6df299dd839f780
2015-11-25Merge "Compile x86 and x86-64 SIMD optimizations"Matt Sarett
2015-11-25Compile x86 and x86-64 SIMD optimizationsMatt Sarett
Change-Id: I2aa903ea44cc3da9255543dd21a312e3dd410b8c
2015-11-24Clean up files used by chromium's copy of libjpeg-turboMatt Sarett
Because we have switched to the latest release from upstream, we no longer need these chromium specific files. Change-Id: Ibca796ddc3479671432afcd0c1d91def4d661cdc
2015-11-24Update libjpeg-turbo to 1.4.2Matt Sarett
BUG:23138693 BUG:25685061
2015-11-23Add Android.mk fileMatt Sarett
2015-11-23Set up config filesMatt Sarett
2015-11-23Further improvements to partial image decodingDRC
When using context-based upsampling, use a dummy color conversion routine instead of a dummy row buffer. This improves performance (since the actual color conversion routine no longer has to be called), and it also fixes valgrind errors when decompressing to RGB565. Valgrind previously complained, because using the RGB565 color converter with the dummy row buffer was causing a table lookup with undefined indices.
2015-11-23Fix a memory leak in jpeg_skip_scanlines()DRC
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1591 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Add jpeg_skip_scanlines() to the Windows DLL export list.DRC
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1589 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Fix compiler warnings in jpeg_skip_scanlines() when building under Visual ↵DRC
Studio. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1588 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Add regression tests for jpeg_skip_scanlines(); change "stripe" to "strip" ↵DRC
in djpeg; document -strip and -skip parameters in djpeg git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1587 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Fix a couple of seg faults discovered when testing the new ↵DRC
jpeg_skip_scanlines() function + remove comment that is no longer relevant. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1586 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Add a -skip option to djpeg, which opens up further regression testing options.DRC
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1583 632fc199-4ca6-4c93-a231-07263d6284db
2015-11-23Add a new libjpeg API function (jpeg_skip_scanlines()) to allow for ↵DRC
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
2015-11-23Change library module name to libjpegMatt Sarett
This new name matches the name of external/jpeg. This will make it easier to replace external/jpeg with this library. Change-Id: Iceaea74c2ca2cd0e6484526ae7281ba39f9d198e
2015-11-20Build using clangMatt Sarett
We still need to disable the clang assembler for ARM v8 devices. BUG:25564571 Change-Id: I8bf3b3a6a9efd1f761811b5829680746a095c151
2015-11-17Add README.version fileMatt Sarett
Change-Id: Ic6cda8ac02fefec110f0c6270313449589471b49
2015-11-11Reenable ARM v8 NEON optimizationsMatt Sarett
For now we can get around the compile problems by using gcc. We should follow up with clang to see about fixing these issues. BUG:25564571 Change-Id: I573e02b19aaa4c3e59e4bd287502068cda49efb4
2015-11-09Further build fixes for x86, x86_64, and mipsMatt Sarett
Change-Id: Ia2b983a15a7fc12d0f47c338f831d5de6e8de75b
2015-11-06Temporarily use jsimd_none.c on N9Matt Sarett
Change-Id: I34d559da7f68fe10ec7aaa72e555626a7be75e72
2015-11-06Temporarily don't compile ARM v8 NEON codeMatt Sarett
Change-Id: Idd23e749fef193ee5ddaba02dad88939c5755ad3
2015-11-04Set include dirs for shared libraryMatt Sarett
Change-Id: Ieb73e8913a0902eea36b43e870337aa06de19a5f
2015-11-03Add makefile for new libjpeg-turbo repositoryMatt Sarett
BUG:25424175 BUG:23138693 Change-Id: I12314248a5c636bca0d69585dfb470ec656d0373
2015-09-21Fix 'make dist'DRC
2015-09-211.4.2DRC
2015-09-21Fix various issues reported by the UB sanitizersDRC
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.
2015-09-16Fix MIPS DSPr2 4:2:0 upsample bug w/ small imagesJames Cowgill
The DSPr2 code was errantly comparing the residual (t9, width & 0xF) with the end pointer (t4, out + width) instead of the width directly (a1). This would give the wrong results with any image whose output width was less than 16. The other small changes (ulw to lw and removal of the nop) are just some easy optimizations around this code. This issue caused a buffer overrun and subsequent segfault on images whose scaled output height was 1 pixel and whose scaled output width was < 16 pixels. Note that the "plain" (non-fancy and non-merged) upsample routine, which was affected by this bug, is normally not used except when decompressing a non-YCbCr JPEG image, but it is also used when decompressing a single-row image (because the other upsampling algorithms require at least two rows.) Closes #16.
2015-09-16Fix x86-64 ABI conformance issue in SIMD codeChandler Carruth
(descriptions cribbed by DRC from discussion in #20) In the x86-64 ABI, the high (unused) DWORD of a 32-bit argument's register is undefined, so it was incorrect to use a 64-bit mov instruction to transfer a JDIMENSION argument in the 64-bit SSE2 SIMD functions. The code worked thus far only because the existing compiler optimizers weren't smart enough to do anything else with the register in question, so the upper 32 bits happened to be all zeroes-- for the past 6 years, on every x86-64 compiler previously known to mankind. The bleeding-edge Clang/LLVM compiler has a smarter optimizer, and under certain circumstances, it will attempt to load-combine adjacent 32-bit integers from one of the libjpeg structures into a single 64-bit integer and pass that 64-bit integer as a 32-bit argument to one of the SIMD functions (which is allowed by the ABI, since the upper 32 bits of the 32-bit argument's register are undefined.) This caused the libjpeg-turbo regression tests to crash. Also enhance the documentation of JDIMENSION to explain that its size is significant to the implementation of the SIMD code. Closes #20. Refer also to http://crbug.com/532214.
2015-09-08Add file that explains the libjpeg-turbo licensesDRC
Previously this information was found in a page on libjpeg-turbo.org, but there was still some confusion, because README-turbo.txt wasn't clear as to which license applied to what.
2015-08-29Fix negative shift with IFAST FDCT and qual=100DRC
With certain images, compressing using quality=100 and the fast integer forward DCT will cause the divisor passed to compute_reciprocal() to be 1. In those cases, the library already disables the SIMD quantization algorithm to avoid 16-bit overflow. However, compute_reciprocal() doesn't properly handle the divisor==1 case, so we need to use special values in that case so that the C quantization algorithm will behave like an identity function.
2015-08-26Eliminate cppcheck false positive in turbojpeg.cDRC
2015-08-14Check range of integer values in PPM text fileFrank Bossen
Add checks to ensure values are within the specified range. Fixes mozilla/mozjpeg#141, closes #8
2015-08-14Check image size when reading targa fileFrank Bossen
Throw an error when image width or height is 0. Fixes mozilla/mozjpeg#140, closes #7.
2015-08-13Fix cjpeg segfault when Windows BMP width/height<0DRC
rdbmp.c used the ambiguous INT32 datatype, which is sometimes typedef'ed to long. Windows bitmap headers use 32-bit signed integers for the width and height, because height can sometimes be negative (this indicates a top-down bitmap.) If biWidth or biHeight was negative and INT32 was a 64-bit long, then biWidth and biHeight were read as a positive integer > INT32_MAX, which failed the test in line 385: if (biWidth <= 0 || biHeight <= 0) ERREXIT(cinfo, JERR_BMP_EMPTY); This commit refactors rdbmp.c so that it uses the datatypes specified by Microsoft for the Windows BMP header. This closes #9 and also provides a better solution for mozilla/mozjpeg#153.
2015-08-13Tabs to spaces in turbojpeg.hDRC
This was a formatting regression in 1.4.x introduced when the new TurboJPEG functions were added.