summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/cio.c
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2015-10-13 15:28:55 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2015-10-13 15:28:55 +0800
commitc212b684cb028a5d98e57f711c9eed931b853a44 (patch)
treef2c937d16b1156f57d8dbc86ec21db11a5b34174 /third_party/libopenjpeg20/cio.c
parent3acb1ef909a22368507ed13817c4988c818e3aee (diff)
downloadpdfium-c212b684cb028a5d98e57f711c9eed931b853a44.tar.xz
upgrade openjpeg to commit# cf352af
BUG=457480,497355 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1338973005 .
Diffstat (limited to 'third_party/libopenjpeg20/cio.c')
-rw-r--r--third_party/libopenjpeg20/cio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/libopenjpeg20/cio.c b/third_party/libopenjpeg20/cio.c
index c455bf7711..b2f6405f6d 100644
--- a/third_party/libopenjpeg20/cio.c
+++ b/third_party/libopenjpeg20/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)
@@ -302,7 +302,7 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
p_stream->m_current_data = p_stream->m_stored_data;
}
- while(1){
+ for (;;) {
/* we should read less than a chunk -> read a chunk */
if (p_size < p_stream->m_buffer_size) {
/* we should do an actual read on the media */
@@ -382,7 +382,7 @@ OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,
return (OPJ_SIZE_T)-1;
}
- while(1) {
+ for (;;) {
l_remaining_bytes = p_stream->m_buffer_size - p_stream->m_bytes_in_buffer;
/* we have more memory than required */