I have some code which encode multiple images (of the same size) in PNG format with only one header. Basically, it does as follow :
Create PNG Struct
Write PNG header
Write 1st image (n*png_write_row, deflateReset at the end)
Reinitialize some fields in png struct
Write 2nd image (n*png_write_row, deflateReset at the end)
Reinitialize some fields in png struct and so on...
Destroy PNG struct
When using standard zlib, all is working fine.
When using ipp_zlib, I get an access violation in ippsCopy_8u (deflate function, line 107 of the function).
It seems that deflateReset has missed something.
I get it to work fine with the following workaround :
[cpp]s = (deflate_state *)strm->state;
s->in_tmpbuff_avail = TMP_BUF_SIZE;
s->in_tmpbuff_next = s->in_tmpbuff_ptr;
s->in_tmpbuff_valid = 1;
s->pending = 0;
s->pending_out = s->pending_buf;
I've never really looked at the code in zlib nor in ipp_zlib so I don't know if that workaround is really valid or if another correction should be made elsewhere. If someone more enlightened than me could have a look to see if using deflateReset really works or if I missed something, it would be great.