Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge commit 4cfa3f4 from libjpeg-turbo #186

Closed
wants to merge 1 commit into from

Conversation

DimitryAndric
Copy link

This commit fixes undefined behavior in jcdctmgr.c's quantize() function, as reported in libjpeg-turbo/libjpeg-turbo#13:

Fix negative shift with IFAST FDCT and qual=100

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.

Fix negative shift with IFAST FDCT and qual=100

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.
@kornelski
Copy link
Member

Has this fix been applied upstream?

Now that libjpeg-turbo uses git I think mozjpeg can merge whole libjpeg-turbo releases instead of cherry-picking commits.

@DimitryAndric
Copy link
Author

Yes, here: libjpeg-turbo/libjpeg-turbo@4cfa3f4. It should end up in libjpeg-turbo 1.4.2, eventually.

@kornelski
Copy link
Member

OK, I'll work on merging that with the rest of the branch soon.

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Sep 13, 2015
This fixes regression tests with clang 3.7.0

PR:		202763
Obtained from:	libjpeg-turbo/libjpeg-turbo@4cfa3f4
Submitted upstream in:	mozilla/mozjpeg#186
Approved by:	maintainer timeout (2 weeks)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@396859 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Sep 13, 2015
This fixes regression tests with clang 3.7.0

PR:		202763
Obtained from:	libjpeg-turbo/libjpeg-turbo@4cfa3f4
Submitted upstream in:	mozilla/mozjpeg#186
Approved by:	maintainer timeout (2 weeks)
felixbuenemann added a commit to felixbuenemann/homebrew-core that referenced this pull request Apr 24, 2016
This adds 64-bit assembly fixes for mozilla/mozjpeg/issues/202 and
a fix for corruption with qual=100 from mozilla/mozjpeg/pull/186.

Both fixes have been in libjpeg-turbo, which mozjpeg is based on for a
long time and have been approved by mozjpeg's pornel for inclusion in a
future mozjpeg release.

See the linked issue / pull request for more info.

The revision bump is because this fixes crashes for existing installs.
@bdaehlie
Copy link
Contributor

bdaehlie commented May 7, 2016

I think we should close this and we'll just take the fix when we merge from upstream. v1.5.0 of libjpeg-turbo should be out mid-June, I think we should just move to that.

@bdaehlie bdaehlie closed this May 7, 2016
apjanke pushed a commit to Homebrew/homebrew-core that referenced this pull request Aug 22, 2016
This adds 64-bit assembly fixes for mozilla/mozjpeg/issues/202 and
a fix for corruption with qual=100 from mozilla/mozjpeg/pull/186.

Both fixes have been in libjpeg-turbo, which mozjpeg is based on for a
long time and have been approved by mozjpeg's pornel for inclusion in a
future mozjpeg release.

See the linked issue / pull request for more info.

The revision bump is because this fixes crashes for existing installs.

Closes #564.

Signed-off-by: Andrew Janke <janke@eilonwy.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants