Bug 1332953 - Update libopus to 1.1.4. r?kinetik draft
authorRalph Giles <giles@mozilla.com>
Tue, 14 Feb 2017 11:03:07 -0800
changeset 483716 f7e98635b57405e945bcc5a3725c675fa09fad2a
parent 483640 fc9f6f7e8e86f00af60ff1ecc72eaf854a6b1ddd
child 545696 125e7b04b53fc1c5f54d55919b10a4715cfcef04
push id45375
push userbmo:giles@thaumas.net
push dateTue, 14 Feb 2017 19:05:43 +0000
reviewerskinetik
bugs1332953
milestone54.0a1
Bug 1332953 - Update libopus to 1.1.4. r?kinetik This fixes a wrap-around issue in SILK LSF stabilization code, addressing CVE-2017-0381. MozReview-Commit-ID: 7yCUoSKNOcl
media/libopus/README_MOZILLA
media/libopus/moz.build
media/libopus/silk/NLSF_stabilize.c
--- a/media/libopus/README_MOZILLA
+++ b/media/libopus/README_MOZILLA
@@ -3,9 +3,9 @@ IETF Opus audio codec reference implemen
 The source in this directory was copied from an opus
 repository checkout by running the ./update.sh script.
 Any changes made to this version of the source should
 be reflected in that script, e.g. by applying patch
 files after the copy step.
 
 The upstream repository is https://git.xiph.org/opus.git
 
-The git tag/revision used was v1.1.3.
+The git tag/revision used was v1.1.4.
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -15,17 +15,17 @@ EXPORTS.opus += [
 ]
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
 
 FINAL_LIBRARY = 'gkmedias'
 
 DEFINES['OPUS_BUILD'] = True
-DEFINES['OPUS_VERSION'] = '"v1.1.3-mozilla"'
+DEFINES['OPUS_VERSION'] = '"v1.1.4-mozilla"'
 DEFINES['USE_ALLOCA'] = True
 
 # Don't export symbols
 DEFINES['OPUS_EXPORT'] = ''
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
     DEFINES['OPUS_ARM_ASM'] = True
     DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True
--- a/media/libopus/silk/NLSF_stabilize.c
+++ b/media/libopus/silk/NLSF_stabilize.c
@@ -125,17 +125,17 @@ void silk_NLSF_stabilize(
         /* Worst case: O(n^2) for an inversely sorted array          */
         silk_insertion_sort_increasing_all_values_int16( &NLSF_Q15[0], L );
 
         /* First NLSF should be no less than NDeltaMin[0] */
         NLSF_Q15[0] = silk_max_int( NLSF_Q15[0], NDeltaMin_Q15[0] );
 
         /* Keep delta_min distance between the NLSFs */
         for( i = 1; i < L; i++ )
-            NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], NLSF_Q15[i-1] + NDeltaMin_Q15[i] );
+            NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], silk_ADD_SAT16( NLSF_Q15[i-1], NDeltaMin_Q15[i] ) );
 
         /* Last NLSF should be no higher than 1 - NDeltaMin[L] */
         NLSF_Q15[L-1] = silk_min_int( NLSF_Q15[L-1], (1<<15) - NDeltaMin_Q15[L] );
 
         /* Keep NDeltaMin distance between the NLSFs */
         for( i = L-2; i >= 0; i-- )
             NLSF_Q15[i] = silk_min_int( NLSF_Q15[i], NLSF_Q15[i+1] - NDeltaMin_Q15[i+1] );
     }