MI_SecureUncompressAny

Syntax

#include <nitro/mi.h>

s32 MI_SecureUncompressAny( const void* srcp, u32 srcSize, void* destp, u32 dstSize );

Arguments

srcp Source address where the compressed data is stored.
srcSize Source data size.
destp Destination address for decompression.
dstSize Destination size for decompression.

Return Values

MI_ERR_SUCCESS Function completed successfully.
MI_ERR_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_DEST_OVERRUN Overrun in the decompression buffer.
MI_ERR_ILLEGAL_TABLE The Huffman table contains mistakes.

Description

Detects the compression format from the data header and executes the appropriate decompression process.

The decompression processes for all of the compression types are linked in this function. Therefore, unless some special kind of compression is being used, it is perhaps more effective to execute the compression-type-specific function instead.

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 MI_SecureUncompress* functions.

See Also

MI_GetUncompressedSize, MI_SecureUncompressRL, MI_SecureUncompressLZ,
MI_SecureUncompressHuffman, MI_SecureUnfilterDiff

Revision History

2008/05/22 Initial version.


CONFIDENTIAL