Bug 202763

Summary: Fix undefined behavior in graphics/mozjpeg
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Antoine Brodin <antoine>
Status: Closed FIXED    
Severity: Affects Some People CC: horia
Priority: --- Flags: bugzilla: maintainer-feedback? (horia)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 201377    
Attachments:
Description Flags
Fix undefined behavior in mozjpeg's jcdctmgr.c none

Description Dimitry Andric freebsd_committer freebsd_triage 2015-08-30 00:27:26 UTC
Created attachment 160506 [details]
Fix undefined behavior in mozjpeg's jcdctmgr.c

Similar to bug 202762, mozjpeg's quantization function can engage in undefined behavior.  It was fixed by this libjpeg-turbo commit:

https://github.com/libjpeg-turbo/libjpeg-turbo/issues/13

I created a pull request for mozjpeg with the same fix:

https://github.com/mozilla/mozjpeg/pull/186

I propose to merge the fix to jcdctmgr.c now, and it can be dropped again when the next version of mozjpeg comes out.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-09-13 20:37:18 UTC
A commit references this bug:

Author: antoine
Date: Sun Sep 13 20:37:06 UTC 2015
New revision: 396859
URL: https://svnweb.freebsd.org/changeset/ports/396859

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

  PR:		202763
  Obtained from:	https://github.com/libjpeg-turbo/libjpeg-turbo/commit/4cfa3f4c39c2e46eca3a65c67411d15e08a3fc70
  Submitted upstream in:	https://github.com/mozilla/mozjpeg/pull/186
  Approved by:	maintainer timeout (2 weeks)

Changes:
  head/graphics/mozjpeg/Makefile
  head/graphics/mozjpeg/files/
  head/graphics/mozjpeg/files/patch-jcdctmgr.c