Commit 827af242 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/rational: Check that av_reduce() returns values within the requested max

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent db0a52d6
......@@ -69,6 +69,7 @@ int av_reduce(int *dst_num, int *dst_den,
den = next_den;
}
av_assert2(av_gcd(a1.num, a1.den) <= 1U);
av_assert2(a1.num <= max && a1.den <= max);
*dst_num = sign ? -a1.num : a1.num;
*dst_den = a1.den;
......
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