/src/FreeImage/Source/LibMNG/libmng_zlib.c

https://bitbucket.org/cabalistic/ogredeps/ · C · 607 lines · 415 code · 98 blank · 94 comment · 106 complexity · 066d6e2e2ce002795c885d61d9e4b499 MD5 · raw file

  1. /* ************************************************************************** */
  2. /* * For conditions of distribution and use, * */
  3. /* * see copyright notice in libmng.h * */
  4. /* ************************************************************************** */
  5. /* * * */
  6. /* * project : libmng * */
  7. /* * file : libmng_zlib.c copyright (c) 2000-2004 G.Juyn * */
  8. /* * version : 1.0.9 * */
  9. /* * * */
  10. /* * purpose : ZLIB library interface (implementation) * */
  11. /* * * */
  12. /* * author : G.Juyn * */
  13. /* * * */
  14. /* * comment : implementation of the ZLIB library interface * */
  15. /* * * */
  16. /* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
  17. /* * - changed strict-ANSI stuff * */
  18. /* * 0.5.1 - 05/11/2000 - G.Juyn * */
  19. /* * - filled the deflatedata routine * */
  20. /* * 0.5.1 - 05/12/2000 - G.Juyn * */
  21. /* * - changed trace to macro for callback error-reporting * */
  22. /* * * */
  23. /* * 0.5.2 - 05/20/2000 - G.Juyn * */
  24. /* * - fixed for JNG alpha handling * */
  25. /* * 0.5.2 - 05/24/2000 - G.Juyn * */
  26. /* * - moved init of default zlib parms from here to * */
  27. /* * "mng_hlapi.c" * */
  28. /* * * */
  29. /* * 0.5.3 - 06/16/2000 - G.Juyn * */
  30. /* * - changed progressive-display processing * */
  31. /* * * */
  32. /* * 0.9.2 - 08/05/2000 - G.Juyn * */
  33. /* * - changed file-prefixes * */
  34. /* * * */
  35. /* * 0.9.3 - 08/08/2000 - G.Juyn * */
  36. /* * - fixed compiler-warnings from Mozilla * */
  37. /* * 0.9.3 - 09/07/2000 - G.Juyn * */
  38. /* * - added support for new filter_types * */
  39. /* * * */
  40. /* * 1.0.5 - 08/07/2002 - G.Juyn * */
  41. /* * - added test-option for PNG filter method 193 (=no filter) * */
  42. /* * 1.0.5 - 08/19/2002 - G.Juyn * */
  43. /* * - B597134 - libmng pollutes the linker namespace * */
  44. /* * 1.0.5 - 09/19/2002 - G.Juyn * */
  45. /* * - added warning for too much IDAT data * */
  46. /* * * */
  47. /* * 1.0.6 - 07/07/2003 - G.R-P * */
  48. /* * - added MNG_NO_16BIT_SUPPORT support * */
  49. /* * * */
  50. /* * 1.0.9 - 10/09/2004 - G.R-P * */
  51. /* * - added MNG_NO_1_2_4BIT_SUPPORT support * */
  52. /* * * */
  53. /* ************************************************************************** */
  54. #include "libmng.h"
  55. #include "libmng_data.h"
  56. #include "libmng_error.h"
  57. #include "libmng_trace.h"
  58. #ifdef __BORLANDC__
  59. #pragma hdrstop
  60. #endif
  61. #include "libmng_memory.h"
  62. #include "libmng_pixels.h"
  63. #include "libmng_filter.h"
  64. #include "libmng_zlib.h"
  65. #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
  66. #pragma option -A /* force ANSI-C */
  67. #endif
  68. /* ************************************************************************** */
  69. #ifdef MNG_INCLUDE_ZLIB
  70. /* ************************************************************************** */
  71. voidpf mngzlib_alloc (voidpf pData,
  72. uInt iCount,
  73. uInt iSize)
  74. {
  75. voidpf pPtr; /* temporary space */
  76. #ifdef MNG_INTERNAL_MEMMNGMT
  77. pPtr = calloc (iCount, iSize); /* local allocation */
  78. #else
  79. if (((mng_datap)pData)->fMemalloc) /* callback function set ? */
  80. pPtr = ((mng_datap)pData)->fMemalloc (iCount * iSize);
  81. else
  82. pPtr = Z_NULL; /* can't allocate! */
  83. #endif
  84. return pPtr; /* return the result */
  85. }
  86. /* ************************************************************************** */
  87. void mngzlib_free (voidpf pData,
  88. voidpf pAddress)
  89. {
  90. #ifdef MNG_INTERNAL_MEMMNGMT
  91. free (pAddress); /* free locally */
  92. #else
  93. if (((mng_datap)pData)->fMemfree) /* callback set? */
  94. ((mng_datap)pData)->fMemfree (pAddress, 1);
  95. #endif
  96. }
  97. /* ************************************************************************** */
  98. mng_retcode mngzlib_initialize (mng_datap pData)
  99. {
  100. #ifdef MNG_SUPPORT_TRACE
  101. MNG_TRACE (pData, MNG_FN_ZLIB_INITIALIZE, MNG_LC_START);
  102. #endif
  103. #ifdef MNG_INTERNAL_MEMMNGMT
  104. pData->sZlib.zalloc = Z_NULL; /* let zlib figure out memory management */
  105. pData->sZlib.zfree = Z_NULL;
  106. pData->sZlib.opaque = Z_NULL;
  107. #else /* use user-provided callbacks */
  108. pData->sZlib.zalloc = mngzlib_alloc;
  109. pData->sZlib.zfree = mngzlib_free;
  110. pData->sZlib.opaque = (voidpf)pData;
  111. #endif
  112. pData->bInflating = MNG_FALSE; /* not performing any action yet */
  113. pData->bDeflating = MNG_FALSE;
  114. #ifdef MNG_SUPPORT_TRACE
  115. MNG_TRACE (pData, MNG_FN_ZLIB_INITIALIZE, MNG_LC_END);
  116. #endif
  117. return MNG_NOERROR; /* done */
  118. }
  119. /* ************************************************************************** */
  120. mng_retcode mngzlib_cleanup (mng_datap pData)
  121. {
  122. #ifdef MNG_SUPPORT_TRACE
  123. MNG_TRACE (pData, MNG_FN_ZLIB_CLEANUP, MNG_LC_START);
  124. #endif
  125. if (pData->bInflating) /* force zlib cleanup */
  126. mngzlib_inflatefree (pData);
  127. if (pData->bDeflating)
  128. mngzlib_deflatefree (pData);
  129. #ifdef MNG_SUPPORT_TRACE
  130. MNG_TRACE (pData, MNG_FN_ZLIB_CLEANUP, MNG_LC_END);
  131. #endif
  132. return MNG_NOERROR; /* done */
  133. }
  134. /* ************************************************************************** */
  135. mng_retcode mngzlib_inflateinit (mng_datap pData)
  136. {
  137. int iZrslt;
  138. #ifdef MNG_SUPPORT_TRACE
  139. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEINIT, MNG_LC_START);
  140. #endif
  141. /* initialize zlib structures and such */
  142. iZrslt = inflateInit (&pData->sZlib);
  143. if (iZrslt != Z_OK) /* on error bail out */
  144. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  145. pData->bInflating = MNG_TRUE; /* really inflating something now */
  146. pData->sZlib.next_out = 0; /* force JIT initialization */
  147. #ifdef MNG_SUPPORT_TRACE
  148. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEINIT, MNG_LC_END);
  149. #endif
  150. return MNG_NOERROR; /* done */
  151. }
  152. /* ************************************************************************** */
  153. #ifdef MNG_SUPPORT_DISPLAY
  154. mng_retcode mngzlib_inflaterows (mng_datap pData,
  155. mng_uint32 iInlen,
  156. mng_uint8p pIndata)
  157. {
  158. int iZrslt;
  159. mng_retcode iRslt;
  160. mng_ptr pSwap;
  161. #ifdef MNG_SUPPORT_TRACE
  162. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEROWS, MNG_LC_START);
  163. #endif
  164. pData->sZlib.next_in = pIndata; /* let zlib know where to get stuff */
  165. pData->sZlib.avail_in = (uInt)iInlen;
  166. if (pData->sZlib.next_out == 0) /* initialize output variables ? */
  167. { /* let zlib know where to store stuff */
  168. pData->sZlib.next_out = pData->pWorkrow;
  169. pData->sZlib.avail_out = (uInt)(pData->iRowsize + pData->iPixelofs);
  170. #ifdef MNG_NO_1_2_4BIT_SUPPORT
  171. if (pData->iPNGdepth < 8)
  172. pData->sZlib.avail_out = (uInt)((pData->iPNGdepth*pData->iRowsize + 7)/8
  173. + pData->iPixelofs);
  174. #endif
  175. #ifdef MNG_NO_16BIT_SUPPORT
  176. if (pData->iPNGdepth > 8)
  177. pData->sZlib.avail_out = (uInt)(2*pData->iRowsize + pData->iPixelofs);
  178. #endif
  179. }
  180. do
  181. { /* now inflate a row */
  182. iZrslt = inflate (&pData->sZlib, Z_SYNC_FLUSH);
  183. /* produced a full row ? */
  184. if (((iZrslt == Z_OK) || (iZrslt == Z_STREAM_END)) &&
  185. (pData->sZlib.avail_out == 0))
  186. { /* image not completed yet ? */
  187. if (pData->iRow < (mng_int32)pData->iDataheight)
  188. {
  189. #ifdef MNG_NO_1_2_4BIT_SUPPORT
  190. if (pData->iPNGdepth == 1)
  191. {
  192. /* Inflate Workrow to 8-bit */
  193. mng_int32 iX;
  194. mng_uint8p pSrc = pData->pWorkrow+1;
  195. mng_uint8p pDest = pSrc + pData->iRowsize - (pData->iRowsize+7)/8;
  196. for (iX = ((pData->iRowsize+7)/8) ; iX > 0 ; iX--)
  197. *pDest++ = *pSrc++;
  198. pDest = pData->pWorkrow+1;
  199. pSrc = pDest + pData->iRowsize - (pData->iRowsize+7)/8;
  200. for (iX = pData->iRowsize; ;)
  201. {
  202. *pDest++ = (((*pSrc)>>7)&1);
  203. if (iX-- <= 0)
  204. break;
  205. *pDest++ = (((*pSrc)>>6)&1);
  206. if (iX-- <= 0)
  207. break;
  208. *pDest++ = (((*pSrc)>>5)&1);
  209. if (iX-- <= 0)
  210. break;
  211. *pDest++ = (((*pSrc)>>4)&1);
  212. if (iX-- <= 0)
  213. break;
  214. *pDest++ = (((*pSrc)>>3)&1);
  215. if (iX-- <= 0)
  216. break;
  217. *pDest++ = (((*pSrc)>>2)&1);
  218. if (iX-- <= 0)
  219. break;
  220. *pDest++ = (((*pSrc)>>1)&1);
  221. if (iX-- <= 0)
  222. break;
  223. *pDest++ = (((*pSrc) )&1);
  224. if (iX-- <= 0)
  225. break;
  226. pSrc++;
  227. }
  228. }
  229. else if (pData->iPNGdepth == 2)
  230. {
  231. /* Inflate Workrow to 8-bit */
  232. mng_int32 iX;
  233. mng_uint8p pSrc = pData->pWorkrow+1;
  234. mng_uint8p pDest = pSrc + pData->iRowsize - (2*pData->iRowsize+7)/8;
  235. for (iX = ((2*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
  236. *pDest++ = *pSrc++;
  237. pDest = pData->pWorkrow+1;
  238. pSrc = pDest + pData->iRowsize - (2*pData->iRowsize+7)/8;
  239. for (iX = pData->iRowsize; ;)
  240. {
  241. *pDest++ = (((*pSrc)>>6)&3);
  242. if (iX-- <= 0)
  243. break;
  244. *pDest++ = (((*pSrc)>>4)&3);
  245. if (iX-- <= 0)
  246. break;
  247. *pDest++ = (((*pSrc)>>2)&3);
  248. if (iX-- <= 0)
  249. break;
  250. *pDest++ = (((*pSrc) )&3);
  251. if (iX-- <= 0)
  252. break;
  253. pSrc++;
  254. }
  255. }
  256. else if (pData->iPNGdepth == 4)
  257. {
  258. /* Inflate Workrow to 8-bit */
  259. mng_int32 iX;
  260. mng_uint8p pSrc = pData->pWorkrow+1;
  261. mng_uint8p pDest = pSrc + pData->iRowsize - (4*pData->iRowsize+7)/8;
  262. for (iX = ((4*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
  263. *pDest++ = *pSrc++;
  264. pDest = pData->pWorkrow+1;
  265. pSrc = pDest + pData->iRowsize - (4*pData->iRowsize+7)/8;
  266. for (iX = pData->iRowsize; ;)
  267. {
  268. *pDest++ = (((*pSrc)>>4)&0x0f);
  269. if (iX-- <= 0)
  270. break;
  271. *pDest++ = (((*pSrc) )&0x0f);
  272. if (iX-- <= 0)
  273. break;
  274. pSrc++;
  275. }
  276. }
  277. if (pData->iPNGdepth < 8 && pData->iColortype == 0)
  278. {
  279. /* Expand samples to 8-bit by LBR */
  280. mng_int32 iX;
  281. mng_uint8p pSrc = pData->pWorkrow+1;
  282. mng_uint8 multiplier[]={0,255,85,0,17,0,0,0,1};
  283. for (iX = pData->iRowsize; iX > 0; iX--)
  284. *pSrc++ *= multiplier[pData->iPNGdepth];
  285. }
  286. #endif
  287. #ifdef MNG_NO_16BIT_SUPPORT
  288. if (pData->iPNGdepth > 8)
  289. {
  290. /* Reduce Workrow to 8-bit */
  291. mng_int32 iX;
  292. mng_uint8p pSrc = pData->pWorkrow+1;
  293. mng_uint8p pDest = pSrc;
  294. for (iX = pData->iRowsize; iX > 0; iX--)
  295. {
  296. *pDest = *pSrc;
  297. pDest++;
  298. pSrc+=2;
  299. }
  300. }
  301. #endif
  302. #ifdef FILTER192 /* has leveling info ? */
  303. if (pData->iFilterofs == MNG_FILTER_DIFFERING)
  304. iRslt = init_rowdiffering (pData);
  305. else
  306. #endif
  307. iRslt = MNG_NOERROR;
  308. /* filter the row if necessary */
  309. if ((!iRslt) && (pData->iFilterofs < pData->iPixelofs ) &&
  310. (*(pData->pWorkrow + pData->iFilterofs)) )
  311. iRslt = mng_filter_a_row (pData);
  312. else
  313. iRslt = MNG_NOERROR;
  314. /* additional leveling/differing ? */
  315. if ((!iRslt) && (pData->fDifferrow))
  316. {
  317. iRslt = ((mng_differrow)pData->fDifferrow) (pData);
  318. pSwap = pData->pWorkrow;
  319. pData->pWorkrow = pData->pPrevrow;
  320. pData->pPrevrow = pSwap; /* make sure we're processing the right data */
  321. }
  322. if (!iRslt)
  323. {
  324. #ifdef MNG_INCLUDE_JNG
  325. if (pData->bHasJHDR) /* is JNG alpha-channel ? */
  326. { /* just store in object ? */
  327. if ((!iRslt) && (pData->fStorerow))
  328. iRslt = ((mng_storerow)pData->fStorerow) (pData);
  329. }
  330. else
  331. #endif /* MNG_INCLUDE_JNG */
  332. { /* process this row */
  333. if ((!iRslt) && (pData->fProcessrow))
  334. iRslt = ((mng_processrow)pData->fProcessrow) (pData);
  335. /* store in object ? */
  336. if ((!iRslt) && (pData->fStorerow))
  337. iRslt = ((mng_storerow)pData->fStorerow) (pData);
  338. /* color correction ? */
  339. if ((!iRslt) && (pData->fCorrectrow))
  340. iRslt = ((mng_correctrow)pData->fCorrectrow) (pData);
  341. /* slap onto canvas ? */
  342. if ((!iRslt) && (pData->fDisplayrow))
  343. {
  344. iRslt = ((mng_displayrow)pData->fDisplayrow) (pData);
  345. if (!iRslt) /* check progressive display refresh */
  346. iRslt = mng_display_progressive_check (pData);
  347. }
  348. }
  349. }
  350. if (iRslt) /* on error bail out */
  351. MNG_ERROR (pData, iRslt);
  352. if (!pData->fDifferrow) /* swap row-pointers */
  353. {
  354. pSwap = pData->pWorkrow;
  355. pData->pWorkrow = pData->pPrevrow;
  356. pData->pPrevrow = pSwap; /* so prev points to the processed row! */
  357. }
  358. iRslt = mng_next_row (pData); /* adjust variables for next row */
  359. if (iRslt) /* on error bail out */
  360. MNG_ERROR (pData, iRslt);
  361. }
  362. /* let zlib know where to store next output */
  363. pData->sZlib.next_out = pData->pWorkrow;
  364. pData->sZlib.avail_out = (uInt)(pData->iRowsize + pData->iPixelofs);
  365. #ifdef MNG_NO_1_2_4BIT_SUPPORT
  366. if (pData->iPNGdepth < 8)
  367. pData->sZlib.avail_out = (uInt)((pData->iPNGdepth*pData->iRowsize + 7)/8
  368. + pData->iPixelofs);
  369. #endif
  370. #ifdef MNG_NO_16BIT_SUPPORT
  371. if (pData->iPNGdepth > 8)
  372. pData->sZlib.avail_out = (uInt)(2*pData->iRowsize + pData->iPixelofs);
  373. #endif
  374. }
  375. } /* until some error or EOI
  376. or all pixels received */
  377. while ( (iZrslt == Z_OK) && (pData->sZlib.avail_in > 0) &&
  378. ( (pData->iRow < (mng_int32)pData->iDataheight) ||
  379. ( (pData->iPass >= 0) && (pData->iPass < 7) ) ) );
  380. /* on error bail out */
  381. if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
  382. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  383. /* too much data ? */
  384. if ((iZrslt == Z_OK) && (pData->sZlib.avail_in > 0))
  385. MNG_WARNING (pData, MNG_TOOMUCHIDAT);
  386. #ifdef MNG_SUPPORT_TRACE
  387. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEROWS, MNG_LC_END);
  388. #endif
  389. return MNG_NOERROR;
  390. }
  391. #endif /* MNG_SUPPORT_DISPLAY */
  392. /* ************************************************************************** */
  393. mng_retcode mngzlib_inflatedata (mng_datap pData,
  394. mng_uint32 iInlen,
  395. mng_uint8p pIndata)
  396. {
  397. int iZrslt;
  398. #ifdef MNG_SUPPORT_TRACE
  399. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEDATA, MNG_LC_START);
  400. #endif
  401. /* let zlib know where to get stuff */
  402. pData->sZlib.next_in = pIndata;
  403. pData->sZlib.avail_in = (uInt)iInlen;
  404. /* now inflate the data in one go! */
  405. iZrslt = inflate (&pData->sZlib, Z_FINISH);
  406. /* not enough room in output-buffer ? */
  407. if ((iZrslt == Z_BUF_ERROR) || (pData->sZlib.avail_in > 0))
  408. return MNG_BUFOVERFLOW;
  409. /* on error bail out */
  410. if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
  411. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  412. #ifdef MNG_SUPPORT_TRACE
  413. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEDATA, MNG_LC_END);
  414. #endif
  415. return MNG_NOERROR;
  416. }
  417. /* ************************************************************************** */
  418. mng_retcode mngzlib_inflatefree (mng_datap pData)
  419. {
  420. int iZrslt;
  421. #ifdef MNG_SUPPORT_TRACE
  422. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEFREE, MNG_LC_START);
  423. #endif
  424. pData->bInflating = MNG_FALSE; /* stopped it */
  425. iZrslt = inflateEnd (&pData->sZlib); /* let zlib cleanup its own stuff */
  426. if (iZrslt != Z_OK) /* on error bail out */
  427. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  428. #ifdef MNG_SUPPORT_TRACE
  429. MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEFREE, MNG_LC_END);
  430. #endif
  431. return MNG_NOERROR; /* done */
  432. }
  433. /* ************************************************************************** */
  434. mng_retcode mngzlib_deflateinit (mng_datap pData)
  435. {
  436. int iZrslt;
  437. #ifdef MNG_SUPPORT_TRACE
  438. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEINIT, MNG_LC_START);
  439. #endif
  440. /* initialize zlib structures and such */
  441. iZrslt = deflateInit2 (&pData->sZlib, pData->iZlevel, pData->iZmethod,
  442. pData->iZwindowbits, pData->iZmemlevel,
  443. pData->iZstrategy);
  444. if (iZrslt != Z_OK) /* on error bail out */
  445. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  446. pData->bDeflating = MNG_TRUE; /* really deflating something now */
  447. #ifdef MNG_SUPPORT_TRACE
  448. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEINIT, MNG_LC_END);
  449. #endif
  450. return MNG_NOERROR; /* done */
  451. }
  452. /* ************************************************************************** */
  453. mng_retcode mngzlib_deflaterows (mng_datap pData,
  454. mng_uint32 iInlen,
  455. mng_uint8p pIndata)
  456. {
  457. #ifdef MNG_SUPPORT_TRACE
  458. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEROWS, MNG_LC_START);
  459. #endif
  460. #ifdef MNG_SUPPORT_TRACE
  461. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEROWS, MNG_LC_END);
  462. #endif
  463. return MNG_NOERROR;
  464. }
  465. /* ************************************************************************** */
  466. mng_retcode mngzlib_deflatedata (mng_datap pData,
  467. mng_uint32 iInlen,
  468. mng_uint8p pIndata)
  469. {
  470. int iZrslt;
  471. #ifdef MNG_SUPPORT_TRACE
  472. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEDATA, MNG_LC_START);
  473. #endif
  474. pData->sZlib.next_in = pIndata; /* let zlib know where to get stuff */
  475. pData->sZlib.avail_in = (uInt)iInlen;
  476. /* now deflate the data in one go! */
  477. iZrslt = deflate (&pData->sZlib, Z_FINISH);
  478. /* not enough room in output-buffer ? */
  479. if ((iZrslt == Z_BUF_ERROR) || (pData->sZlib.avail_in > 0))
  480. return MNG_BUFOVERFLOW;
  481. /* on error bail out */
  482. if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
  483. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  484. #ifdef MNG_SUPPORT_TRACE
  485. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEDATA, MNG_LC_END);
  486. #endif
  487. return MNG_NOERROR;
  488. }
  489. /* ************************************************************************** */
  490. mng_retcode mngzlib_deflatefree (mng_datap pData)
  491. {
  492. int iZrslt;
  493. #ifdef MNG_SUPPORT_TRACE
  494. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEFREE, MNG_LC_START);
  495. #endif
  496. iZrslt = deflateEnd (&pData->sZlib); /* let zlib cleanup its own stuff */
  497. if (iZrslt != Z_OK) /* on error bail out */
  498. MNG_ERRORZ (pData, (mng_uint32)iZrslt);
  499. pData->bDeflating = MNG_FALSE; /* stopped it */
  500. #ifdef MNG_SUPPORT_TRACE
  501. MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEFREE, MNG_LC_END);
  502. #endif
  503. return MNG_NOERROR; /* done */
  504. }
  505. /* ************************************************************************** */
  506. #endif /* MNG_INCLUDE_ZLIB */
  507. /* ************************************************************************** */
  508. /* * end of file * */
  509. /* ************************************************************************** */