diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-09 01:57:37 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-29 06:56:48 +0400 |
commit | 5bb347a3b4a88ce4c4de6d0a1dbb0e351cc326f6 (patch) | |
tree | 22e8eb4906f866ed5c144f4612f391e898831a0f | |
parent | 4e17e9f8afc41de33f45bf8ae4f60a30f932a2c7 (diff) |
dct-test: fix order of evaluation bug
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dd081f98dded8e268a70468a43b25b077c8c3571)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/dct-test.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 9fdf7d179d..7dd7f616c5 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -234,8 +234,10 @@ static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, in break; case 1: j = av_lfg_get(prng) % 10 + 1; - for (i = 0; i < j; i++) - block[av_lfg_get(prng) % 64] = av_lfg_get(prng) % (2*vals) -vals; + for (i = 0; i < j; i++) { + int idx = av_lfg_get(prng) % 64; + block[idx] = av_lfg_get(prng) % (2*vals) -vals; + } break; case 2: block[ 0] = av_lfg_get(prng) % (16*vals) - (8*vals); |