Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-08 02:19:07 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-04-08 02:25:49 +0400
commitf9158b01d0f3effb58e87fb07db0382bc1e47de5 (patch)
tree96888283b1878177eec7a511b3b36b40a247d0d5 /libswresample/resample.c
parent0d225863f2c9855c6c39890da63f1fc6d6fb9391 (diff)
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>
Diffstat (limited to 'libswresample/resample.c')
-rw-r--r--libswresample/resample.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 581382faa6..77653a7a9f 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;