diff --git a/plugins/bmp/xp/ie_impGraphic_BMP.cpp b/plugins/bmp/xp/ie_impGraphic_BMP.cpp index 6203fea..bbad77a 100644 --- a/plugins/bmp/xp/ie_impGraphic_BMP.cpp +++ b/plugins/bmp/xp/ie_impGraphic_BMP.cpp @@ -191,7 +191,10 @@ UT_Error IE_ImpGraphic_BMP::_convertGraphic(UT_ByteBuf * pBB) /* Clean Up Memory Used */ - FREEP(m_pPNGInfo->palette); + png_colorp palette = 0; + int numClrs = 0; + png_get_PLTE(m_pPNG, m_pPNGInfo, &palette, &numClrs); + FREEP(palette); DELETEP(pBB); png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); @@ -313,7 +316,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_PNG() * the normal method of doing things with libpng). REQUIRED unless you * set up your own error handlers in the png_create_read_struct() earlier. */ - if (setjmp(m_pPNG->jmpbuf)) + if (setjmp(png_jmpbuf(m_pPNG))) { /* Free all of the memory associated with the png_ptr and info_ptr */ png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); @@ -332,7 +335,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_PNG() UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB) { /* Reset error handling for libpng */ - if (setjmp(m_pPNG->jmpbuf)) + if (setjmp(png_jmpbuf(m_pPNG))) { png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); return UT_ERROR; @@ -372,7 +375,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_PNG() UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB) { /* Reset error handling for libpng */ - if (setjmp(m_pPNG->jmpbuf)) + if (setjmp(png_jmpbuf(m_pPNG))) { png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); return UT_ERROR; diff --git a/plugins/garble/xp/abiword-garble-png.cpp b/plugins/garble/xp/abiword-garble-png.cpp index 889e4ad..4846f9c 100644 --- a/plugins/garble/xp/abiword-garble-png.cpp +++ b/plugins/garble/xp/abiword-garble-png.cpp @@ -79,7 +79,7 @@ bool abiword_document::garble_png( void*& data, size_t& size ) { png_set_strip_alpha( png_ptr ); png_set_interlace_handling( png_ptr ); png_set_bgr( png_ptr ); - rowbytes = info_ptr->rowbytes; + rowbytes = png_get_rowbytes( png_ptr, info_ptr ); png_destroy_read_struct( &png_ptr, &info_ptr, NULL ); }