Lines 191-197
Link Here
|
191 |
|
191 |
|
192 |
/* Clean Up Memory Used */ |
192 |
/* Clean Up Memory Used */ |
193 |
|
193 |
|
194 |
FREEP(m_pPNGInfo->palette); |
|
|
195 |
DELETEP(pBB); |
194 |
DELETEP(pBB); |
196 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
195 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
197 |
|
196 |
|
Lines 313-319
Link Here
|
313 |
* the normal method of doing things with libpng). REQUIRED unless you |
312 |
* the normal method of doing things with libpng). REQUIRED unless you |
314 |
* set up your own error handlers in the png_create_read_struct() earlier. |
313 |
* set up your own error handlers in the png_create_read_struct() earlier. |
315 |
*/ |
314 |
*/ |
316 |
if (setjmp(m_pPNG->jmpbuf)) |
315 |
if (setjmp(png_jmpbuf(m_pPNG))) |
317 |
{ |
316 |
{ |
318 |
/* Free all of the memory associated with the png_ptr and info_ptr */ |
317 |
/* Free all of the memory associated with the png_ptr and info_ptr */ |
319 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
318 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
Lines 332-338
Link Here
|
332 |
UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB) |
331 |
UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB) |
333 |
{ |
332 |
{ |
334 |
/* Reset error handling for libpng */ |
333 |
/* Reset error handling for libpng */ |
335 |
if (setjmp(m_pPNG->jmpbuf)) |
334 |
if (setjmp(png_jmpbuf(m_pPNG))) |
336 |
{ |
335 |
{ |
337 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
336 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
338 |
return UT_ERROR; |
337 |
return UT_ERROR; |
Lines 365-370
Link Here
|
365 |
if (iOffset > m_iOffset) return UT_IE_BOGUSDOCUMENT; |
364 |
if (iOffset > m_iOffset) return UT_IE_BOGUSDOCUMENT; |
366 |
|
365 |
|
367 |
png_set_PLTE( m_pPNG, m_pPNGInfo, palette, numClrs ); |
366 |
png_set_PLTE( m_pPNG, m_pPNGInfo, palette, numClrs ); |
|
|
367 |
png_data_freer( m_pPNG, m_pPNGInfo, PNG_DESTROY_WILL_FREE_DATA, PNG_FREE_PLTE ); |
368 |
|
368 |
|
369 |
return UT_OK; |
369 |
return UT_OK; |
370 |
} |
370 |
} |
Lines 372-378
Link Here
|
372 |
UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB) |
372 |
UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB) |
373 |
{ |
373 |
{ |
374 |
/* Reset error handling for libpng */ |
374 |
/* Reset error handling for libpng */ |
375 |
if (setjmp(m_pPNG->jmpbuf)) |
375 |
if (setjmp(png_jmpbuf(m_pPNG))) |
376 |
{ |
376 |
{ |
377 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
377 |
png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); |
378 |
return UT_ERROR; |
378 |
return UT_ERROR; |