Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on opj_write_bytes_BE function #472

Closed
gcode-importer opened this issue Feb 6, 2015 · 1 comment
Closed

Bug on opj_write_bytes_BE function #472

gcode-importer opened this issue Feb 6, 2015 · 1 comment

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 472

In cio.c source of openjp2. I have found a bug when encode jp2 in Big-endian platform

Function:
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)

Bug code line:
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes;

Fixed: 
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(OPJ_UINT32) -
p_nb_bytes;

Reported by vominh2012 on 2015-02-06 01:47:41

@mayeut
Copy link
Collaborator

mayeut commented Jul 17, 2015

Related to PR #521

@mayeut mayeut closed this as completed in 8c4afef Jul 25, 2015
@mayeut mayeut added this to the OPJ v2.1.1 milestone Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants