diff options
| author | Matthieu Darbois <mayeut@users.noreply.github.com> | 2015-07-25 15:54:26 +0200 |
|---|---|---|
| committer | Matthieu Darbois <mayeut@users.noreply.github.com> | 2015-07-25 15:54:26 +0200 |
| commit | 8c4afeff40857138aada9f3301a43d4dfce7b7ed (patch) | |
| tree | 9e8487aec28bea650942b04ee93872685f143bbc /src/lib | |
| parent | ffd9db970068bd6ee502e46f7f69e46d6fc7c21a (diff) | |
| parent | c665e81a393616cfbfb9c18727617438dac2ac88 (diff) | |
Merge pull request #521 from manisandro/bigendian
Fix opj_write_bytes_BE
Fixes #472
Fixes #345
Fixes #518
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/openjp2/cio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/openjp2/cio.c b/src/lib/openjp2/cio.c index c455bf77..c6f778c9 100644 --- a/src/lib/openjp2/cio.c +++ b/src/lib/openjp2/cio.c @@ -46,7 +46,7 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes) { - const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes; + const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value)+sizeof(OPJ_UINT32)-p_nb_bytes; assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32)); @@ -72,7 +72,7 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32)); *p_value = 0; - memcpy(l_data_ptr+4-p_nb_bytes,p_buffer,p_nb_bytes); + memcpy(l_data_ptr+sizeof(OPJ_UINT32)-p_nb_bytes,p_buffer,p_nb_bytes); } void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes) |
