[FFmpeg-cvslog] avcodec/jpeg2000dwt: Fill array using 2d instead of 1d accesses

Michael Niedermayer git at videolan.org
Sat Jun 20 02:33:53 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 20 02:11:56 2015 +0200| [5358953cdfb8fe16e2d9d8cc5df4b417935c6bf2] | committer: Michael Niedermayer

avcodec/jpeg2000dwt: Fill array using 2d instead of 1d accesses

Avoids gcc warning

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5358953cdfb8fe16e2d9d8cc5df4b417935c6bf2
---

 libavcodec/jpeg2000dwt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 4e7bfa1..e8b3e12 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -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;



More information about the ffmpeg-cvslog mailing list