#include <nitro/mi.h>
s32 MI_SecureUncompressHuffman( const void *srcp, u32 srcSize, void *destp, u32 dstSize );
srcp | Source address of Huffman compression data. |
srcSize | Source data size. |
destp | Destination address for decompression. |
dstSize | Destination size for decompression. |
MI_ERR_SUCCESS | Function completed successfully. |
MIRR_UNSUPPORTED | Unsupported compression data type. |
MI_ERR_SRC_SHORTAGE | Source data size is too small. |
MI_ERR_SRC_REMAINDER | Source data size is too large. |
MI_ERR_ILLEGAL_TABLE | The Huffman table contains mistakes. |
Decompresses Huffman compression data and writes it in 32-bit units to the specified memory. The source address must be aligned to a 4-byte boundary.
To perform streaming uncompression of data, use the MI_ReadUncompHuffman
function.
By calling MI_GetUncompressedSize
as a reference when allocating the destination buffer size, you can get the post-compression data size, which is written in the header of the compressed data. Even if the header of the compressed data is corrupted and the correct value could not be obtained, it will detect and return any errors within the SecureUncompress*
functions.
MI_GetUncompressedSize, MI_UncompressHuffman, MI_InitUncompContextHuffman, MI_ReadUncompHuffman, MI_CompressHuffman, ntrcomp
2008/05/22 Initial version.
CONFIDENTIAL