aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dct-test.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-08 23:57:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-08 23:57:37 +0200
commitdd081f98dded8e268a70468a43b25b077c8c3571 (patch)
tree4d2073372a80e05a775241d2d4b8266d088e43be /libavcodec/dct-test.c
parentd40c0e4a6733ade9aaafc687bcaccc0cba1183b4 (diff)
downloadffmpeg-dd081f98dded8e268a70468a43b25b077c8c3571.tar.gz
dct-test: fix order of evaluation bug
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dct-test.c')
-rw-r--r--libavcodec/dct-test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index b44b68bfe9..a277817452 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -215,8 +215,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);