avcodec/jpeg2000dwt: Fill array using 2d instead of 1d accesses
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Jun 2015 00:11:56 +0000 (02:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Jun 2015 00:14:19 +0000 (02:14 +0200)
Avoids gcc warning

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000dwt.c

index 4e7bfa1..e8b3e12 100644 (file)
@@ -659,7 +659,7 @@ int main(void) {
 
     for (i = 0; i < 40; i++) {
         for (j=0; j<4; j++)
-            border[0][j] = av_lfg_get(&prng) % MAX_W;
+            border[j>>1][j&1] = av_lfg_get(&prng) % MAX_W;
         if (border[0][0] >= border[0][1] || border[1][0] >= border[1][1])
             continue;
         decomp_levels = av_lfg_get(&prng) % FF_DWT_MAX_DECLVLS;