Skip to content

Commit 7008163

Browse files
committed
nrf_compress: lzma: Fix last part variable check
Fixes an issue where the variable checked was not the correct one, though the check would pass in most scenarios Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 58160e9 commit 7008163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/nrf_compress/src/lzma.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,14 @@ static int lzma_decompress(void *inst, const uint8_t *input, size_t input_size,
451451

452452
#ifdef CONFIG_NRF_COMPRESS_LZMA_VERSION_LZMA2
453453
if (lzma_decoder.decoder.dicPos >= lzma_decoder.decoder.dicBufSize ||
454-
(last_part && input_size == chunk_size)) {
454+
(last_part && input_size == *offset)) {
455455
*output = lzma_decoder.decoder.dic;
456456
*output_size = lzma_decoder.decoder.dicPos;
457457
lzma_decoder.decoder.dicPos = 0;
458458
}
459459
#else
460460
if (lzma_decoder.dicPos >= lzma_decoder.dicBufSize ||
461-
(last_part && input_size == chunk_size)) {
461+
(last_part && input_size == *offset)) {
462462
*output = lzma_decoder.dic;
463463
*output_size = lzma_decoder.dicPos;
464464
lzma_decoder.dicPos = 0;

0 commit comments

Comments
 (0)