MI_SecureUncompressRL

Syntax

#include <nitro/mi.h>

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

Arguments

srcp The source address where run-length 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.

Description

This function decompresses run-length compressed data and writes the data to the specified region of memory. The source address must be aligned to a 4-byte boundary.

To perform streaming uncompression of data, use the MI_ReadUncompRL 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.

See Also

MI_GetUncompressedSize, MI_UncompressRL, MI_InitUncompContextRL, MI_ReadUncompRL, MI_CompressRL, ntrcomp

Revision History

2008/05/22 Initial version.


CONFIDENTIAL