From 8c4d7d30621b7d446b25964a840080fc765a1492 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 19 Jan 2016 16:44:57 +0100 Subject: Adjust offset for windowed frames --- src/ufodecode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ufodecode.c') diff --git a/src/ufodecode.c b/src/ufodecode.c index b72726b..46af883 100644 --- a/src/ufodecode.c +++ b/src/ufodecode.c @@ -229,7 +229,7 @@ ufo_decode_frame_channels_v5 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3 } static size_t -ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint32_t *raw, size_t num_rows) +ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint32_t *raw, size_t num_rows, uint16_t start_offset) { size_t base = 0; size_t index = 0; @@ -241,7 +241,7 @@ ufo_decode_frame_channels_v6 (UfoDecoder *decoder, uint16_t *pixel_buffer, uint3 #endif while (raw[base] != 0xAAAAAAA) { - const size_t row_number = raw[base] & 0xfff; + const size_t row_number = (raw[base] & 0xfff) - start_offset; const size_t pixel_number = (raw[base + 1] >> 16) & 0xfff; base += 2; @@ -472,7 +472,7 @@ ufo_decoder_decode_frame (UfoDecoder *decoder, uint32_t *raw, size_t num_bytes, break; case 6: - advance = ufo_decode_frame_channels_v6 (decoder, pixels, raw + pos, rows_per_frame); + advance = ufo_decode_frame_channels_v6 (decoder, pixels, raw + pos, rows_per_frame, meta->cmosis_start_address); break; default: -- cgit v1.2.3