avutil/rational: Check that av_reduce() returns values within the requested max
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 29 Dec 2014 14:52:34 +0000 (15:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 29 Dec 2014 14:52:34 +0000 (15:52 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/rational.c

index 55a8dd5..594a6f8 100644 (file)
@@ -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;