~ubuntu-branches/ubuntu/trusty/libjpeg-turbo/trusty-proposed

« back to all changes in this revision

Viewing changes to java/TJUnitTest.java

  • Committer: Package Import Robot
  • Author(s): Matthias Klose, Tom Gall, Matthias Klose
  • Date: 2012-09-20 00:18:15 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120920001815-eijk7v63d1nv0vbo
Tags: 1.2.1-0ubuntu1
[ Tom Gall ]
* Update to stable 1.2.1. LP: #1012861.
  * Addresses CVE-2012-2806. LP: #1025537.
    A Heap-based buffer overflow was found in the way libjpeg-turbo
    decompressed certain corrupt JPEG images in which the component count
    was erroneously set to a large value. An attacker could create a
    specially-crafted JPEG image that, when opened, could cause an
    application using libpng to crash or, possibly, execute arbitrary code
    with the privileges of the user running the application.
  * Cosmetic fixes to argument lists
  * Added flags to the TurboJPEG API that allow the caller to force
    the use of either the fast or the accurate DCT/IDCT algorithms
    in the underlying codec.
  * More recent versions of autoconf add -traditional-cpp to the CPP
    flags, which causes jsimdcfg.inc.h to not preprocess correctly
    unless we expand all of the instances of the #definev macro.
  * Fixed regression caused by a bug in the 32-bit strict memory access
    code in jdmrgss2.asm (contributed by Chromium to stop valgrind from
    whining whenever the output buffer size was not evenly divisible by
    16 bytes.)  On Linux/x86, this regression generated incorrect
    pixels on the right-hand side of images whose rows were not 16-byte
    aligned, whenever fancy upsampling was used.  This patch also
    enables the strict memory access code on all platforms, not just
    Linux (it does no harm on other platforms) and removes a couple of
    pcmpeqb instructions that were rendered unnecessary by r835.
  * Accelerated 4:2:2 upsampling routine for ARM (improves
    performance ~20-30% when decompressing 4:2:2 JPEGs using
    fancy upsampling)
  * Eliminate the use of the MASKMOVDQU instruction, to speed
    up decompression performance by 10x on AMD Bobcat embedded
    processors (and ~5% on AMD desktop processors.)
  * add tjbench to libjpeg-turbo-test packages
  * Guard against num_components being a ridiculous
    value due to a corrupt header
  * Preserve all 128 bits of xmm6 and xmm7

[ Matthias Klose ]
* Prepare the package for quantal, basing on the 1.2.1 release tarball.
* d/patches/branch-updates.diff: Update to 20120919 of the 1.2.x branch,
  but don't bump the version to 1.2.2.
* d/patches/guard-inline-define: Remove, integrated upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C)2011 D. R. Commander.  All Rights Reserved.
 
2
 * Copyright (C)2011-2012 D. R. Commander.  All Rights Reserved.
3
3
 *
4
4
 * Redistribution and use in source and binary forms, with or without
5
5
 * modification, are permitted provided that the following conditions are met:
765
765
      for(int pf : formats) {
766
766
        for(int i = 0; i < 2; i++) {
767
767
          int flags = 0;
 
768
          if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420
 
769
            || subsamp == TJ.SAMP_440)
 
770
            flags |= TJ.FLAG_FASTUPSAMPLE;
768
771
          if(i == 1) {
769
772
            if(yuv == YUVDECODE) {
770
773
              tjc.close();  tjd.close();  return;
850
853
      if(doyuv) yuv = YUVENCODE;
851
854
      doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444, testName);
852
855
      doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444, testName);
853
 
      if(doyuv) {
854
 
        doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,
855
 
          testName);
856
 
        doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,
857
 
          testName);
858
 
        doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,
859
 
          testName);
860
 
        doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,
861
 
          testName);
862
 
        doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,
863
 
          testName);
864
 
        doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,
865
 
          testName);
866
 
      }
 
856
      doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,
 
857
        testName);
 
858
      doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,
 
859
        testName);
 
860
      doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,
 
861
        testName);
 
862
      doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,
 
863
        testName);
 
864
      doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,
 
865
        testName);
 
866
      doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,
 
867
        testName);
867
868
      doTest(35, 39, bi ? onlyGrayBI : onlyGray, TJ.SAMP_GRAY, testName);
868
869
      doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_GRAY,
869
870
        testName);