Patch from Callum Lewick. Fixed dwt.c where an alignment in buffer was problematic...
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 27 Sep 2007 12:20:12 +0000 (12:20 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 27 Sep 2007 12:20:12 +0000 (12:20 +0000)
ChangeLog
libopenjpeg/dwt.c

index 0a919d464c5098ad5304cd960b6d94971f7c6c88..636bac851364563c4cecb3b8b5e393a7a14a4503 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ What's New for OpenJPEG
 ! : changed
 + : added
 
+September 27, 2007
+* [FOD] Patch from Callum Lewick. Fixed dwt.c where an alignment in buffer was problematic under x86_64.
+
 September 25, 2007
 * [Mathieu Malaterre] BUG: Fix previous patch from Callum Lerwick. I have no
     clue what CMAKE_INSTALL_LIBDIR refers too. Bump up cmake 2.2 restriction to
index d10de185473ea121c59e79ea4832def10ba72c31..2bd41ba398ba0e243908b84df5fe50d22b961885 100644 (file)
@@ -604,7 +604,6 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t * tilec, int stop, DWT1DFN dwt_1D
        int i, j, k;
        int *a = NULL;
        int *aj = NULL;
-       int *m;
        int w; //, l;
        int rw;                 /* width of the resolution level computed  */
        int rh;                 /* heigth of the resolution level computed  */
@@ -619,8 +618,8 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t * tilec, int stop, DWT1DFN dwt_1D
        w = tilec->x1-tilec->x0;
        a = tilec->data;
 
-       m = (int*)opj_malloc(sizeof(int) * (dwt_decode_max_resolution(tr, i)+5));
-       h.mem = v.mem = (int*)( (unsigned)m + 16 - ( (unsigned)m % 16 ) ) ;
+       h.mem = (int*) opj_aligned_malloc(dwt_decode_max_resolution(tr, i) * sizeof(int));
+       v.mem = h.mem;
 
        rw = tr->x1 - tr->x0;
        rh = tr->y1 - tr->y0;
@@ -657,5 +656,5 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t * tilec, int stop, DWT1DFN dwt_1D
                        aj++;
                }
        }
-       opj_free(m);
+       opj_aligned_free(h.mem);
 }