Commit 352b0969 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f9158b01

)
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
Showing with 5 additions and 0 deletions
+5 -0
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment