dHRUSHIT / miniz

Automatically exported from code.google.com/p/miniz
0 stars 0 forks source link

Has anyone got it working on android devices (arm based platforms) #42

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Just curious has anyone got miniz working on arm-based Android devices. 

I had a stripped down version of miniz (v115_r4), which contains only 
mz_compress() and mz_uncompress() functions and their dependenices. It is 
working well on a Ubuntu desktop, however, after I ported it to Android, I 
found that if the compress block size is 16K bytes or bigger, the compression 
can easily fail. Most time it failed silently, I only noticed the problem when 
trying to uncompress the compressed the content. 

Confirmed the issue is on the compression side by trying to uncompress the same 
compressed block using miniz on Ubuntu PC, it failed with the same error: 
MZ_DATA_ERROR. Also tried using miniz on Ubuntu PC to compress and uncompress 
the same original data block (16Kbytes), and it works fine.

I will for sure debug further and report back to this thread, just in case 
someone already done the simliar porting work and knows what need to be tweaked 
...

Btw, Rich, very nice tool, thanks a lot for sharing. 

Original issue reported on code.google.com by weiche...@gmail.com on 24 Oct 2014 at 3:36

GoogleCodeExporter commented 9 years ago
Same problem here, did you catch it?

Original comment by werner.p...@gmail.com on 15 Dec 2014 at 3:55

GoogleCodeExporter commented 9 years ago
Thanks weichence. I'm going to have an android dev environment setup at work 
soon, so I should be able to try reproducing this.

Original comment by richge...@gmail.com on 15 Dec 2014 at 4:10

GoogleCodeExporter commented 9 years ago
Small information:

it fails line 1463:
if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); }

counter is set to 1 by the line above, where out_buf_size_mask = -1
((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))

Original comment by werner.p...@gmail.com on 15 Dec 2014 at 4:16

GoogleCodeExporter commented 9 years ago
Hi Rich:

I got it working, it turned out to be some stupid copy/paste mistake I made 
when trying to further simplify your code. 

Original comment by weiche...@gmail.com on 15 Dec 2014 at 4:16

GoogleCodeExporter commented 9 years ago
Got it working now as well. The Keil compiler didn't like the initialization of 
the following array:

tdefl_write_image_to_png_file_in_memory_ex

mz_uint8 pnghdr[41]

Original comment by werner.p...@gmail.com on 16 Dec 2014 at 12:04