Bug 1341254 - Put the modification made to the resampler code in bug 1274083 into their own patch, and add this patch to update.sh. r=karlt
authorPaul Adenot <paul@paul.cx>
Mon, 06 Mar 2017 16:15:07 +0100
changeset 347148 4b1b4e0d85790a4cc752993c1cbf12e4a4ce0e3d
parent 347147 5489cbc85d069be1f20a164c9dd5fb79b7a5ec3d
child 347149 c8df499e005abc1438c394dfa72257e369097d7d
push id31491
push usercbook@mozilla.com
push dateMon, 13 Mar 2017 14:24:00 +0000
treeherdermozilla-central@8d9fd089cabd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1341254, 1274083
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1341254 - Put the modification made to the resampler code in bug 1274083 into their own patch, and add this patch to update.sh. r=karlt MozReview-Commit-ID: IAOWdGS0jM
media/libspeex_resampler/set-rate-overflow-no-return.patch
media/libspeex_resampler/update.sh
new file mode 100644
--- /dev/null
+++ b/media/libspeex_resampler/set-rate-overflow-no-return.patch
@@ -0,0 +1,23 @@
+--- a/media/libspeex_resampler/src/resample.c
++++ b/media/libspeex_resampler/src/resample.c
+@@ -1146,17 +1146,19 @@ EXPORT int speex_resampler_set_rate_frac
+       }
+    }
+       
+    if (old_den > 0)
+    {
+       for (i=0;i<st->nb_channels;i++)
+       {
+          if (!_muldiv_safe(st->samp_frac_num[i],st->den_rate,old_den))
+-            return RESAMPLER_ERR_OVERFLOW;
++         {
++             st->samp_frac_num[i] = st->den_rate-1;
++         }
+          st->samp_frac_num[i]= _muldiv(st->samp_frac_num[i],st->den_rate,old_den);
+          /* Safety net */
+          if (st->samp_frac_num[i] >= st->den_rate)
+             st->samp_frac_num[i] = st->den_rate-1;
+       }
+    }
+    
+    if (st->initialised)
--- a/media/libspeex_resampler/update.sh
+++ b/media/libspeex_resampler/update.sh
@@ -22,8 +22,9 @@ cp $1/COPYING .
 # apply outstanding local patches
 patch -p3 < outside-speex.patch
 patch -p3 < simd-detect-runtime.patch
 patch -p3 < set-skip-frac.patch
 patch -p3 < hugemem.patch
 patch -p3 < remove-empty-asm-clobber.patch
 patch -p3 < handle-memory-error.patch
 patch -p3 < fix-overflow.patch
+patch -p3 < set-rate-overflow-no-return.patch