if (l_img_comp_src->sgnd) {
for (j = 0; j < l_height_dest; ++j) {
for (k = 0; k < l_width_dest; ++k) {
- *(l_dest_ptr++) = *(l_src_ptr++);
+ OPJ_INT16 val;
+ memcpy(&val, l_src_ptr, sizeof(val));
+ l_src_ptr ++;
+ *(l_dest_ptr++) = val;
}
l_dest_ptr += l_line_offset_dest;
} else {
for (j = 0; j < l_height_dest; ++j) {
for (k = 0; k < l_width_dest; ++k) {
- *(l_dest_ptr++) = (*(l_src_ptr++)) & 0xffff;
+ OPJ_INT16 val;
+ memcpy(&val, l_src_ptr, sizeof(val));
+ l_src_ptr ++;
+ *(l_dest_ptr++) = val & 0xffff;
}
l_dest_ptr += l_line_offset_dest;
l_src_ptr += l_start_offset_src;
for (j = 0; j < l_height_dest; ++j) {
- for (k = 0; k < l_width_dest; ++k) {
- *(l_dest_ptr++) = (*(l_src_ptr++));
- }
-
- l_dest_ptr += l_line_offset_dest;
- l_src_ptr += l_line_offset_src ;
+ memcpy(l_dest_ptr, l_src_ptr, l_width_dest * sizeof(OPJ_INT32));
+ l_dest_ptr += l_width_dest + l_line_offset_dest;
+ l_src_ptr += l_width_dest + l_line_offset_src ;
}
l_src_ptr += l_end_offset_src;
if (l_img_comp->sgnd) {
for (j = 0; j < l_height; ++j) {
for (k = 0; k < l_width; ++k) {
- *(l_dest_ptr++) = (OPJ_INT16)(*(l_src_ptr++));
+ OPJ_INT16 val = (OPJ_INT16)(*(l_src_ptr++));
+ memcpy(l_dest_ptr, &val, sizeof(val));
+ l_dest_ptr ++;
}
l_src_ptr += l_stride;
}
} else {
for (j = 0; j < l_height; ++j) {
for (k = 0; k < l_width; ++k) {
- *(l_dest_ptr++) = (OPJ_INT16)((*(l_src_ptr++)) & 0xffff);
+ OPJ_INT16 val = (OPJ_INT16)((*(l_src_ptr++)) & 0xffff);
+ memcpy(l_dest_ptr, &val, sizeof(val));
+ l_dest_ptr ++;
}
l_src_ptr += l_stride;
}
OPJ_INT32 * l_src_ptr = l_tilec->data;
for (j = 0; j < l_height; ++j) {
- for (k = 0; k < l_width; ++k) {
- *(l_dest_ptr++) = (*(l_src_ptr++));
- }
- l_src_ptr += l_stride;
+ memcpy(l_dest_ptr, l_src_ptr, l_width * sizeof(OPJ_INT32));
+ l_dest_ptr += l_width;
+ l_src_ptr += l_width + l_stride;
}
p_dest = (OPJ_BYTE*) l_dest_ptr;