diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-10 18:29:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-10 18:31:07 +0100 |
commit | 15efd9a7c0a6ccc59c07c3118a2e075449c91e68 (patch) | |
tree | d37ee430dd5c892ab8462337f6d2ebd699265c1d /libavutil/mathematics.c | |
parent | 0d82c3a0ca6c5ed1e757a826b966687382f0180e (diff) | |
parent | 36017d49e2f797f7371dc24848a2285ca63e39ab (diff) | |
download | ffmpeg-15efd9a7c0a6ccc59c07c3118a2e075449c91e68.tar.gz |
Merge commit '36017d49e2f797f7371dc24848a2285ca63e39ab' into release/0.10
* commit '36017d49e2f797f7371dc24848a2285ca63e39ab':
Prepare for 0.8.11 Release
lavf: make av_probe_input_buffer more robust
Updated Changelog for 0.8.10
oggparseogm: check timing variables
mathematics: remove asserts from av_rescale_rnd()
vc1: Always reset numref when parsing a new frame header.
h264: reset num_reorder_frames if it is invalid
Conflicts:
RELEASE
libavcodec/vc1.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mathematics.c')
-rw-r--r-- | libavutil/mathematics.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c index 180f72e3f0..2fe4a7c36b 100644 --- a/libavutil/mathematics.c +++ b/libavutil/mathematics.c @@ -23,7 +23,6 @@ * miscellaneous math routines and tables */ -#include <assert.h> #include <stdint.h> #include <limits.h> #include "mathematics.h" @@ -77,9 +76,9 @@ int64_t av_gcd(int64_t a, int64_t b){ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){ int64_t r=0; - assert(c > 0); - assert(b >=0); - assert((unsigned)rnd<=5 && rnd!=4); + + if (c <= 0 || b < 0 || rnd == 4 || rnd > 5) + return INT64_MIN; if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1)); |