diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index e13daa69b..7b643ca02 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -2362,7 +2362,6 @@ void CLASS sony_arq_load_raw() int bits = 0; while (1 << ++bits < maximum) ; - ++bits; bits = (1 << bits) - 1; for (int row = 0; row < ((frame < 2) ? 1 : raw_height); row++) { @@ -2376,8 +2375,8 @@ void CLASS sony_arq_load_raw() read_shorts(samples, 4 * raw_width); if (r < raw_height) { int offset = 2 * (r & 1); - for (int c = (frame >> 1) & 1; c < raw_width; ++c, offset = (offset + 4) ^ 1) { - RAW(r, c) = samples[offset] & bits; + for (int c = (frame >> 1) & 1; c < raw_width; ++c, offset += 4) { + RAW(r, c) = samples[offset + (c & 1)] & bits; } } }