aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-08 00:19:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 15:10:07 +0200
commit37f854f5b958486c2ca215cd54b60728d94e224f (patch)
tree6f3a45564f8d5e8ffc71e3d9a8f64e8fcc38b210
parent9c83914a1fd6bb9d19d5d81a4c25264176c2c25c (diff)
downloadffmpeg-37f854f5b958486c2ca215cd54b60728d94e224f.tar.gz
swresample/resample: Limit filter length
Related to CID1197063 The limit choosen is arbitrary and much larger than what makes sense. It avoids the need for checking arithmetic operations with the length for overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f9158b01d0f3effb58e87fb07db0382bc1e47de5) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswresample/resample.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8b1b6ca9af..b968447444 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -229,6 +229,11 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
av_assert0(0);
}
+ if (filter_size/factor > INT32_MAX/256) {
+ av_log(NULL, AV_LOG_ERROR, "Filter length too large\n");
+ goto error;
+ }
+
c->phase_shift = phase_shift;
c->phase_mask = phase_count - 1;
c->linear = linear;