Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 6bb696b

Browse files
committed
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 --HG-- extra : rebase_source : ca9d38acb50f7fa8818d50fd8370d98b5d21e4f9
1 parent 2681077 commit 6bb696b

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--- a/media/libspeex_resampler/src/resample.c
2+
+++ b/media/libspeex_resampler/src/resample.c
3+
@@ -1146,17 +1146,19 @@ EXPORT int speex_resampler_set_rate_frac
4+
}
5+
}
6+
7+
if (old_den > 0)
8+
{
9+
for (i=0;i<st->nb_channels;i++)
10+
{
11+
if (!_muldiv_safe(st->samp_frac_num[i],st->den_rate,old_den))
12+
- return RESAMPLER_ERR_OVERFLOW;
13+
+ {
14+
+ st->samp_frac_num[i] = st->den_rate-1;
15+
+ }
16+
st->samp_frac_num[i]= _muldiv(st->samp_frac_num[i],st->den_rate,old_den);
17+
/* Safety net */
18+
if (st->samp_frac_num[i] >= st->den_rate)
19+
st->samp_frac_num[i] = st->den_rate-1;
20+
}
21+
}
22+
23+
if (st->initialised)

media/libspeex_resampler/update.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ patch -p3 < hugemem.patch
2727
patch -p3 < remove-empty-asm-clobber.patch
2828
patch -p3 < handle-memory-error.patch
2929
patch -p3 < fix-overflow.patch
30+
patch -p3 < set-rate-overflow-no-return.patch

0 commit comments

Comments
 (0)