summaryrefslogtreecommitdiff
path: root/libavutil/mathematics.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-04 01:18:33 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-04 01:27:59 +0100
commit3929c17405e010896e56b7791084ffd9fcee3a3d (patch)
treedb615300e5c57be7f8ad2b6ccd96fc26f21924a6 /libavutil/mathematics.c
parent405b1ef898bf9ee509d2642bdf5bad05d9faa1ce (diff)
parent94a417acc05cc5151b473abc0bf51fad26f8c5a0 (diff)
downloadffmpeg-3929c17405e010896e56b7791084ffd9fcee3a3d.tar.gz
Merge commit '94a417acc05cc5151b473abc0bf51fad26f8c5a0'
* commit '94a417acc05cc5151b473abc0bf51fad26f8c5a0': mathematics: remove asserts from av_rescale_rnd() Conflicts: libavutil/mathematics.c The asserts are left in place for now as no code checks the return value, but we sure can change this if application developers prefer Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mathematics.c')
-rw-r--r--libavutil/mathematics.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index f9cf87da80..2e0cf0cbd4 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -63,6 +63,9 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
av_assert2(b >=0);
av_assert2((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4);
+ if (c <= 0 || b < 0 || !((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4))
+ return INT64_MIN;
+
if (rnd & AV_ROUND_PASS_MINMAX) {
if (a == INT64_MIN || a == INT64_MAX)
return a;