mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-17 12:30:11 +01:00
mathematics: remove asserts from av_rescale_rnd()
It is a public function, it must not assert on its parameters. (cherry picked from commit94a417acc0) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit03bfd8419f) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
committed by
Reinhard Tartler
parent
30c8a5e4f6
commit
e03b875c0b
@@ -23,7 +23,6 @@
|
|||||||
* miscellaneous math routines and tables
|
* miscellaneous math routines and tables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include "mathematics.h"
|
#include "mathematics.h"
|
||||||
@@ -76,9 +75,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 av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
|
||||||
int64_t r=0;
|
int64_t r=0;
|
||||||
assert(c > 0);
|
|
||||||
assert(b >=0);
|
if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
|
||||||
assert((unsigned)rnd<=5 && rnd!=4);
|
return INT64_MIN;
|
||||||
|
|
||||||
if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
|
if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user