+// SPDX-License-Identifier: GPL-2.0+
/*
* Usefuls routines based on the LzmaTest.c file from LZMA SDK 4.65
*
* Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com)
*
* Copyright (C) 1999-2005 Igor Pavlov
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/*
return SZ_ERROR_OUTPUT_EOF;
/* Decompress */
- outProcessed = outSizeFull;
+ outProcessed = min(outSizeFull, *uncompressedSize);
WATCHDOG_RESET();
inStream, LZMA_PROPS_SIZE, LZMA_FINISH_END, &state, &g_Alloc);
*uncompressedSize = outProcessed;
- debug("LZMA: Uncompresed ................ 0x%zx\n", outProcessed);
+ debug("LZMA: Uncompressed ............... 0x%zx\n", outProcessed);
if (res != SZ_OK) {
return res;