From: Brett H. <bi...@li...> - 2016-07-23 05:11:01
|
Hi, I think I have found an issue with reading a png which came inside an mp3. The extracted png is attached, if you want the original mp3 I can supply. Note I have only tested memory read with the mp3 file. File read via pngstest did not experience the issue. I have found no issue with other png files. This png loads fine in libpng 1.7.0beta64 and prior but since beta65 and tested up to beta83 from git repo I get abort() in png_image_finish_read() My code basically is: png_image image; LPVOID m_pBitmapData; memset(&image, 0, (sizeof image)); image.version = PNG_IMAGE_VERSION; png_image_begin_read_from_memory(&image, pCompressedData, ulDataLength); image.format = PNG_FORMAT_BGRA; if(m_pBitmapData) { free(m_pBitmapData); m_pBitmapData = NULL; } m_pBitmapData = malloc(PNG_IMAGE_SIZE(image)); if(!m_pBitmapData) return false; png_image_finish_read (&image, NULL, m_pBitmapData, 0, NULL)) png_image_free(&image); Both my code and libpng are built with Visual Studio 14/2015 What I find is that libpng gives a warning(pre beta64 also gave the same warning): "known incorrect sRGB profile" after png_image_begin_read_from_memory. But when I call png_image_finish_read on beta 65 and later I get an abort() Any suggestions? |