diff --git a/src/RageSurface_Save_PNG.cpp b/src/RageSurface_Save_PNG.cpp index f60ae44d65..25cf308bfe 100644 --- a/src/RageSurface_Save_PNG.cpp +++ b/src/RageSurface_Save_PNG.cpp @@ -90,7 +90,7 @@ static bool RageSurface_Save_PNG( RageFile &f, char szErrorbuf[1024], RageSurfac png_info *pInfo = png_create_info_struct(pPng); if( pInfo == NULL ) { - png_destroy_read_struct( &pPng, NULL, NULL ); + png_destroy_write_struct( &pPng, NULL ); if( bDeleteImg ) delete pImg; sprintf( szErrorbuf, "creating png_create_info_struct failed"); @@ -99,7 +99,7 @@ static bool RageSurface_Save_PNG( RageFile &f, char szErrorbuf[1024], RageSurfac if( setjmp(png_jmpbuf(pPng)) ) { - png_destroy_read_struct( &pPng, &pInfo, NULL ); + png_destroy_write_struct( &pPng, &pInfo ); return false; } diff --git a/src/Texture Font Generator/Utils.cpp b/src/Texture Font Generator/Utils.cpp index d0509b9ed3..57941f5c8d 100644 --- a/src/Texture Font Generator/Utils.cpp +++ b/src/Texture Font Generator/Utils.cpp @@ -162,14 +162,14 @@ bool SavePNG( FILE *f, char szErrorbuf[1024], const Surface *pSurf ) png_info *pInfo = png_create_info_struct(pPng); if( pInfo == NULL ) { - png_destroy_read_struct( &pPng, NULL, NULL ); + png_destroy_write_struct( &pPng, NULL ); sprintf( szErrorbuf, "creating png_create_info_struct failed"); return false; } if( setjmp(png_jmpbuf(pPng)) ) { - png_destroy_read_struct( &pPng, &pInfo, NULL ); + png_destroy_write_struct( &pPng, &pInfo ); return false; }