unsigned int i = 0, j = 0;
void *large_rect = NULL;
void *small_rect= NULL;
+ unsigned int rounddown_h = MM_UTIL_ROUND_DOWN_16(height);
- if (cinfo->image_height - MM_UTIL_ROUND_DOWN_16(height)) {
+ if (cinfo->image_height != rounddown_h) {
large_rect = g_malloc0(width);
small_rect = g_malloc0(width);
memset(large_rect, 0x10, width);
memset(small_rect, 0x80, width);
- for (j = 0; j < height; j += 16) {
+ for (j = 0; j < rounddown_h; j += 16) {
for (i = 0; i < 16; i++) {
y[i] = (JSAMPROW)decoded->data + width * (i + j);
if (i % 2 == 0) {
}
jpeg_write_raw_data(cinfo, data, 16);
}
- for (i = 0; i < cinfo->image_height - MM_UTIL_ROUND_DOWN_16(height); i++) {
+ for (i = 0; i < cinfo->image_height - rounddown_h; i++) {
y[i] = (JSAMPROW)decoded->data + width * (i + j);
if (i % 2 == 0) {
cb[i / 2] = (JSAMPROW)decoded->data + width * height + width / 2 * ((i + j) / 2);