Wednesday, December 4, 2013

zlib decompression uncompress no problem on IPhone4, always fail on IPhone3GS

Zlib decompression have used it?
I have no problem calling uncompress
on IPhone4In IPhone3GS (ios4.2) in respect of not always extract the failure to see the return value -5, looking mean target memory is not enough, I set up a lot of memory still has a large reported this error than is required, there is no one encountered Such ah?
Reply:
-5 Should be buf error:
Z_BUF_ERROR

 
const char * const z_errmsg [10] = {
"Need dictionary", / * Z_NEED_DICT 2 * /
"Stream end", / * Z_STREAM_END 1 * /
"", / * Z_OK 0 * /
"File error", / * Z_ERRNO (-1) * /
"Stream error", / * Z_STREAM_ERROR (-2) * /
"Data error", / * Z_DATA_ERROR (-3) * /
"Insufficient memory", / * Z_MEM_ERROR (-4) * /
"Buffer error", / * Z_BUF_ERROR (-5) * /
"Incompatible version", / * Z_VERSION_ERROR (-6) * /
""};


So, you should check buf settings are correct.
Reply:
Interception code Notes:
if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
(For example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
fatal, and deflate () can be called again with more input and more output
space to continue compressing.

Buf is probably not enough.

Reply:
Source code search Z_BUF_ERROR may get the wrong reasons
Reply:
buffer size should be enough, the same code under IPHOHE4 is good, I specifically in increasing the size of the buffer, the result is still the same.
Reply:
Friendship Bangding, this really has not done .....

No comments:

Post a Comment