[FFmpeg-cvslog] vf_noise: Fix av_lfg_get() maximum value
Michael Niedermayer
git at videolan.org
Sat Apr 6 20:07:15 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 6 19:58:30 2013 +0200| [28943c4d31a56ec6fe1ddb019d312412de7b630b] | committer: Michael Niedermayer
vf_noise: Fix av_lfg_get() maximum value
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28943c4d31a56ec6fe1ddb019d312412de7b630b
---
libavfilter/vf_noise.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index be39cb2..e9a4aa3 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -126,8 +126,8 @@ static int init_noise(NoiseContext *n, int comp)
} else {
double x1, x2, w, y1;
do {
- x1 = 2.0 * av_lfg_get(lfg) / (float)RAND_MAX - 1.0;
- x2 = 2.0 * av_lfg_get(lfg) / (float)RAND_MAX - 1.0;
+ x1 = 2.0 * av_lfg_get(lfg) / (float)UINT_MAX - 1.0;
+ x2 = 2.0 * av_lfg_get(lfg) / (float)UINT_MAX - 1.0;
w = x1 * x1 + x2 * x2;
} while (w >= 1.0);
More information about the ffmpeg-cvslog
mailing list