Bug 202762 - Fix undefined behavior in graphics/jpeg-turbo (resulting in test errors with recent clang)
Summary: Fix undefined behavior in graphics/jpeg-turbo (resulting in test errors with ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Antoine Brodin
Depends on:
Blocks: 201377
  Show dependency treegraph
Reported: 2015-08-29 23:49 UTC by Dimitry Andric
Modified: 2015-09-13 20:28 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bytestore)

Fix undefined behavior in libjpeg-turbo's jcdctmgr.c (2.12 KB, patch)
2015-08-29 23:49 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2015-08-29 23:49:46 UTC
Created attachment 160505 [details]
Fix undefined behavior in libjpeg-turbo's jcdctmgr.c

During the exp-run in bug 201377, it was found that graphics/jpeg-turbo gives testing errors with a recent clang 3.7.0 snapshot, on amd64:


This is caused by undefined behavior in libjpeg-turbo's quantization function.  It was reported upstream here:


and subsequently fixed in this upstream commit:


I propose to merge the fix to jcdctmgr.c now, and it can be dropped again when libjpeg-turbo 1.4.2 comes out.
Comment 1 commit-hook freebsd_committer 2015-09-13 20:27:15 UTC
A commit references this bug:

Author: antoine
Date: Sun Sep 13 20:27:08 UTC 2015
New revision: 396855
URL: https://svnweb.freebsd.org/changeset/ports/396855

  Fix negative shift with IFAST FDCT and qual=100
  This fixes regression tests with clang 3.7.0

  PR:		202762
  Obtained from:	https://github.com/libjpeg-turbo/libjpeg-turbo/commit/4cfa3f4c39c2e46eca3a65c67411d15e08a3fc70
  Approved by:	maintainer timeout (15 days)