Commit a7be8a33 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:mercury233/irrlicht into develop

parents 9144cc0b 368b43c8
.DS_Store .DS_Store
/source/Irrlicht/MacOSX/build /source/Irrlicht/MacOSX/build
/source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.xcworkspace /source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.xcworkspace
/source/Irrlicht/MacOSX/MacOSX.xcodeproj/xcuserdata /source/Irrlicht/MacOSX/MacOSX.xcodeproj/xcuserdata
/source/Irrlicht/libpng/ci
/source/Irrlicht/libpng/contrib
/source/Irrlicht/libpng/projects
/source/Irrlicht/libpng/scripts
/source/Irrlicht/libpng/tests
/source/Irrlicht/libpng/loongarch
/source/Irrlicht/libpng/mips
/source/Irrlicht/libpng/powerpc
/source/Irrlicht/libpng/riscv
/source/Irrlicht/libpng/.appveyor.yml
/source/Irrlicht/libpng/.cmake-format.yaml
/source/Irrlicht/libpng/.editorconfig
/source/Irrlicht/libpng/.editorconfig-checker.json
/source/Irrlicht/libpng/.gitignore
/source/Irrlicht/libpng/.markdownlint.yml
/source/Irrlicht/libpng/.yamllint.yml
/source/Irrlicht/libpng/.github
/source/Irrlicht/libpng/aclocal.m4
/source/Irrlicht/libpng/autogen.sh
/source/Irrlicht/libpng/compile
/source/Irrlicht/libpng/config.guess
/source/Irrlicht/libpng/config.h.in
/source/Irrlicht/libpng/config.sub
/source/Irrlicht/libpng/configure
/source/Irrlicht/libpng/configure.ac
/source/Irrlicht/libpng/depcomp
/source/Irrlicht/libpng/INSTALL
/source/Irrlicht/libpng/install-sh
/source/Irrlicht/libpng/libpng-config.in
/source/Irrlicht/libpng/libpng.pc.in
/source/Irrlicht/libpng/ltmain.sh
/source/Irrlicht/libpng/Makefile.am
/source/Irrlicht/libpng/Makefile.in
/source/Irrlicht/libpng/missing
/source/Irrlicht/libpng/test-driver
/source/Irrlicht/zlib/make_vms.com
/bin/MacOSX /bin/MacOSX
/irrlicht.patch /irrlicht.patch
/premake*.lua /premake*.lua
...@@ -325,9 +325,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader(LPCSTR pSrcData, ...@@ -325,9 +325,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader(LPCSTR pSrcData,
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
io::path strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -385,9 +385,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcF ...@@ -385,9 +385,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcF
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
io::path strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -446,9 +446,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShader(LPCSTR pSrcData, UINT ...@@ -446,9 +446,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShader(LPCSTR pSrcData, UINT
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
io::path strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
...@@ -506,9 +506,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFi ...@@ -506,9 +506,9 @@ HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFi
if (!pFn && !LoadFailed) if (!pFn && !LoadFailed)
{ {
// try to load dll // try to load dll
io::path strDllName = "d3dx9_"; irr::core::string<TCHAR> strDllName = __TEXT("d3dx9_");
strDllName += (int)D3DX_SDK_VERSION; strDllName += (int)D3DX_SDK_VERSION;
strDllName += ".dll"; strDllName += __TEXT(".dll");
HMODULE hMod = LoadLibrary(strDllName.c_str()); HMODULE hMod = LoadLibrary(strDllName.c_str());
if (hMod) if (hMod)
......
...@@ -325,7 +325,7 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -325,7 +325,7 @@ bool CGUIListBox::OnEvent(const SEvent& event)
LastKeyTime = now; LastKeyTime = now;
// find the selected item, starting at the current selection // find the selected item, starting at the current selection
s32 start = Selected; const s32 start = Selected;
// dont change selection if the key buffer matches the current item // dont change selection if the key buffer matches the current item
if (Selected > -1 && KeyBuffer.size() > 1) if (Selected > -1 && KeyBuffer.size() > 1)
{ {
...@@ -341,7 +341,8 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -341,7 +341,8 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{ {
if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size()))) if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size())))
{ {
if (Parent && Selected != current && !Selecting && !MoveOverSelect) setSelected(current);
if (Parent && start != current && !Selecting && !MoveOverSelect)
{ {
SEvent e; SEvent e;
e.EventType = EET_GUI_EVENT; e.EventType = EET_GUI_EVENT;
...@@ -350,7 +351,6 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -350,7 +351,6 @@ bool CGUIListBox::OnEvent(const SEvent& event)
e.GUIEvent.EventType = EGET_LISTBOX_CHANGED; e.GUIEvent.EventType = EGET_LISTBOX_CHANGED;
Parent->OnEvent(e); Parent->OnEvent(e);
} }
setSelected(current);
return true; return true;
} }
} }
...@@ -361,9 +361,9 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -361,9 +361,9 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{ {
if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size()))) if (KeyBuffer.equals_ignore_case(Items[current].text.subString(0,KeyBuffer.size())))
{ {
if (Parent && Selected != current && !Selecting && !MoveOverSelect) setSelected(current);
if (Parent && start != current && !Selecting && !MoveOverSelect)
{ {
Selected = current;
SEvent e; SEvent e;
e.EventType = EET_GUI_EVENT; e.EventType = EET_GUI_EVENT;
e.GUIEvent.Caller = this; e.GUIEvent.Caller = this;
...@@ -371,7 +371,6 @@ bool CGUIListBox::OnEvent(const SEvent& event) ...@@ -371,7 +371,6 @@ bool CGUIListBox::OnEvent(const SEvent& event)
e.GUIEvent.EventType = EGET_LISTBOX_CHANGED; e.GUIEvent.EventType = EGET_LISTBOX_CHANGED;
Parent->OnEvent(e); Parent->OnEvent(e);
} }
setSelected(current);
return true; return true;
} }
} }
......
...@@ -141,7 +141,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const ...@@ -141,7 +141,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const
return 0; return 0;
#else #else
if (!file) if (!(file && file->seek(0)))
return 0; return 0;
Filename = file->getFileName(); Filename = file->getFileName();
......
...@@ -69,7 +69,7 @@ bool CImageLoaderPng::isALoadableFileExtension(const io::path& filename) const ...@@ -69,7 +69,7 @@ bool CImageLoaderPng::isALoadableFileExtension(const io::path& filename) const
bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const
{ {
#ifdef _IRR_COMPILE_WITH_LIBPNG_ #ifdef _IRR_COMPILE_WITH_LIBPNG_
if (!file) if (!(file && file->seek(0)))
return false; return false;
png_byte buffer[8]; png_byte buffer[8];
...@@ -89,7 +89,7 @@ bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const ...@@ -89,7 +89,7 @@ bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const
IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const
{ {
#ifdef _IRR_COMPILE_WITH_LIBPNG_ #ifdef _IRR_COMPILE_WITH_LIBPNG_
if (!file) if (!(file && file->seek(0)))
return 0; return 0;
video::IImage* image = 0; video::IImage* image = 0;
......
...@@ -1101,7 +1101,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) ...@@ -1101,7 +1101,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
// create the window if we need to and we do not use the null device // create the window if we need to and we do not use the null device
if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL) if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL)
{ {
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32"); const TCHAR* ClassName = __TEXT("CIrrDeviceWin32");
// Register Class // Register Class
WNDCLASSEX wcex; WNDCLASSEX wcex;
...@@ -1472,7 +1472,7 @@ void CIrrDeviceWin32::closeDevice() ...@@ -1472,7 +1472,7 @@ void CIrrDeviceWin32::closeDevice()
if (!ExternalWindow) if (!ExternalWindow)
{ {
DestroyWindow(HWnd); DestroyWindow(HWnd);
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32"); const TCHAR* ClassName = __TEXT("CIrrDeviceWin32");
HINSTANCE hInstance = GetModuleHandle(0); HINSTANCE hInstance = GetModuleHandle(0);
UnregisterClass(ClassName, hInstance); UnregisterClass(ClassName, hInstance);
} }
......
...@@ -89,7 +89,7 @@ bool COpenGLDriver::changeRenderContext(const SExposedVideoData& videoData, CIrr ...@@ -89,7 +89,7 @@ bool COpenGLDriver::changeRenderContext(const SExposedVideoData& videoData, CIrr
bool COpenGLDriver::initDriver(CIrrDeviceWin32* device) bool COpenGLDriver::initDriver(CIrrDeviceWin32* device)
{ {
// Create a window to test antialiasing support // Create a window to test antialiasing support
const fschar_t* ClassName = __TEXT("GLCIrrDeviceWin32"); const TCHAR* ClassName = __TEXT("GLCIrrDeviceWin32");
HINSTANCE lhInstance = GetModuleHandle(0); HINSTANCE lhInstance = GetModuleHandle(0);
// Register Class // Register Class
......
...@@ -521,7 +521,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -521,7 +521,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
//99 - AES encryption, WinZip 9 //99 - AES encryption, WinZip 9
const SZipFileEntry &e = FileInfo[Files[index].ID]; const SZipFileEntry &e = FileInfo[Files[index].ID];
wchar_t buf[64];
s16 actualCompressionMethod=e.header.CompressionMethod; s16 actualCompressionMethod=e.header.CompressionMethod;
IReadFile* decrypted=0; IReadFile* decrypted=0;
u8* decryptedBuf=0; u8* decryptedBuf=0;
...@@ -620,8 +619,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -620,8 +619,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -633,8 +631,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -633,8 +631,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -674,8 +671,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -674,8 +671,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != Z_OK) if (err != Z_OK)
{ {
swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Error decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -694,8 +690,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -694,8 +690,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -707,8 +702,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -707,8 +702,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -745,8 +739,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -745,8 +739,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != BZ_OK) if (err != BZ_OK)
{ {
swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Error decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -766,8 +759,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -766,8 +759,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
c8* pBuf = new c8[ uncompressedSize ]; c8* pBuf = new c8[ uncompressedSize ];
if (!pBuf) if (!pBuf)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
if (decrypted) if (decrypted)
decrypted->drop(); decrypted->drop();
return 0; return 0;
...@@ -779,8 +771,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -779,8 +771,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
pcData = new u8[decryptedSize]; pcData = new u8[decryptedSize];
if (!pcData) if (!pcData)
{ {
swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); os::Printer::log("Not enough memory for decompressing", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
delete [] pBuf; delete [] pBuf;
return 0; return 0;
} }
...@@ -826,8 +817,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) ...@@ -826,8 +817,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR); os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR);
return 0; return 0;
default: default:
swprintf ( buf, 64, L"file has unsupported compression method. %s", Files[index].FullName.c_str() ); os::Printer::log("file has unsupported compression method.", Files[index].FullName, ELL_ERROR);
os::Printer::log( buf, ELL_ERROR);
return 0; return 0;
}; };
......
...@@ -1265,6 +1265,7 @@ ...@@ -1265,6 +1265,7 @@
<Unit filename="libpng/pngset.c"> <Unit filename="libpng/pngset.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
<Unit filename="libpng/pngstruct.h" />
<Unit filename="libpng/pngtrans.c"> <Unit filename="libpng/pngtrans.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
......
...@@ -494,6 +494,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -494,6 +494,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
if(!CreationParams.WindowId) //load menus if standalone application if(!CreationParams.WindowId) //load menus if standalone application
{ {
[[NSAutoreleasePool alloc] init]; [[NSAutoreleasePool alloc] init];
[[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular];
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; [NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]];
[NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]]; [NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]];
......
libpng 1.6.47 - February 18, 2025 libpng 1.6.55 - February 9, 2026
================================= ================================
This is a public release of libpng, intended for use in production code. This is a public release of libpng, intended for use in production code.
...@@ -7,15 +7,12 @@ This is a public release of libpng, intended for use in production code. ...@@ -7,15 +7,12 @@ This is a public release of libpng, intended for use in production code.
Files available for download Files available for download
---------------------------- ----------------------------
Source files with LF line endings (for Unix/Linux): Source files:
* libpng-1.6.47.tar.xz (LZMA-compressed, recommended) * libpng-1.6.55.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.47.tar.gz (deflate-compressed) * libpng-1.6.55.tar.gz (deflate-compressed)
* lpng1655.7z (LZMA-compressed)
Source files with CRLF line endings (for Windows): * lpng1655.zip (deflate-compressed)
* lpng1647.7z (LZMA-compressed, recommended)
* lpng1647.zip (deflate-compressed)
Other information: Other information:
...@@ -25,22 +22,16 @@ Other information: ...@@ -25,22 +22,16 @@ Other information:
* TRADEMARK.md * TRADEMARK.md
Changes from version 1.6.46 to version 1.6.47 Changes from version 1.6.54 to version 1.6.55
--------------------------------------------- ---------------------------------------------
* Modified the behaviour of colorspace chunks in order to adhere * Fixed CVE-2026-25646 (high severity):
to the new precedence rules formulated in the latest draft of Heap buffer overflow in `png_set_quantize`.
the PNG Specification. (Reported and fixed by Joshua Inscoe.)
(Contributed by John Bowler) * Resolved an oss-fuzz build issue involving nalloc.
* Fixed a latent bug in `png_write_iCCP`. (Contributed by Philippe Antoine.)
This would have been a read-beyond-end-of-malloc vulnerability,
introduced early in the libpng-1.6.0 development, yet (fortunately!)
it was inaccessible before the above-mentioned modification of the
colorspace precedence rules, due to pre-existing colorspace checks.
(Reported by Bob Friesenhahn; fixed by John Bowler)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net. Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement <https://lists.sourceforge.net/lists/listinfo/png-mng-implement>
to subscribe. to subscribe.
...@@ -5,6 +5,7 @@ This is the list of PNG Reference Library ("libpng") Contributing ...@@ -5,6 +5,7 @@ This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes. Authors, for copyright and licensing purposes.
* Adam Richter * Adam Richter
* Alexander Smorkalov
* Andreas Dilger * Andreas Dilger
* Chris Blume * Chris Blume
* Cosmin Truta * Cosmin Truta
...@@ -16,21 +17,25 @@ Authors, for copyright and licensing purposes. ...@@ -16,21 +17,25 @@ Authors, for copyright and licensing purposes.
* Guy Eric Schalnat * Guy Eric Schalnat
* James Yu * James Yu
* John Bowler * John Bowler
* Joshua Inscoe
* Kevin Bracey * Kevin Bracey
* Lucas Chollet * Lucas Chollet
* Magnus Holmgren * Magnus Holmgren
* Mandar Sahastrabuddhe * Mandar Sahastrabuddhe
* Manfred Schlaegl
* Mans Rullgard * Mans Rullgard
* Matt Sarett * Matt Sarett
* Mike Klein * Mike Klein
* Pascal Massimino * Pascal Massimino
* Paul Schmidt * Paul Schmidt
* Petr Simecek
* Philippe Antoine * Philippe Antoine
* Qiang Zhou * Qiang Zhou
* Sam Bushell * Sam Bushell
* Samuel Williams * Samuel Williams
* Simon-Pierre Cadieux * Simon-Pierre Cadieux
* Tim Wegner * Tim Wegner
* Tobias Stoeckmann
* Tom Lane * Tom Lane
* Tom Tanner * Tom Tanner
* Vadim Barkov * Vadim Barkov
...@@ -40,8 +45,9 @@ Authors, for copyright and licensing purposes. ...@@ -40,8 +45,9 @@ Authors, for copyright and licensing purposes.
- Zixu Wang (王子旭) - Zixu Wang (王子旭)
* Arm Holdings * Arm Holdings
- Richard Townsend - Richard Townsend
* Google Inc. * Google LLC
- Dan Field - Dan Field
- Dragoș Tiselice
- Leon Scroggins III - Leon Scroggins III
- Matt Sarett - Matt Sarett
- Mike Klein - Mike Klein
...@@ -51,6 +57,10 @@ Authors, for copyright and licensing purposes. ...@@ -51,6 +57,10 @@ Authors, for copyright and licensing purposes.
- GuXiWei (顾希伟) - GuXiWei (顾希伟)
- JinBo (金波) - JinBo (金波)
- ZhangLixia (张利霞) - ZhangLixia (张利霞)
* Samsung Group
- Filip Wasil
* SpacemiT Hangzhou Technology, Co.
- Liang Junzhao (梁俊钊)
The build projects, the build scripts, the test scripts, and other The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have files in the "projects", "scripts" and "tests" directories, have
......
...@@ -5988,7 +5988,7 @@ Version 1.6.32rc01 [August 18, 2017] ...@@ -5988,7 +5988,7 @@ Version 1.6.32rc01 [August 18, 2017]
Version 1.6.32rc02 [August 22, 2017] Version 1.6.32rc02 [August 22, 2017]
Added contrib/oss-fuzz directory which contains files used by the oss-fuzz Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
project (https://github.com/google/oss-fuzz/tree/master/projects/libpng). project <https://github.com/google/oss-fuzz/tree/master/projects/libpng>.
Version 1.6.32 [August 24, 2017] Version 1.6.32 [August 24, 2017]
No changes. No changes.
...@@ -6251,7 +6251,93 @@ Version 1.6.47 [February 18, 2025] ...@@ -6251,7 +6251,93 @@ Version 1.6.47 [February 18, 2025]
colorspace precedence rules, due to pre-existing colorspace checks. colorspace precedence rules, due to pre-existing colorspace checks.
(Reported by Bob Friesenhahn; fixed by John Bowler) (Reported by Bob Friesenhahn; fixed by John Bowler)
Version 1.6.48 [April 30, 2025]
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
(Reported by Mohit Bakshi; fixed by John Bowler)
Added #error directives to discourage the inclusion of private
libpng implementation header files in PNG-supporting applications.
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
alternative to `DFA_XTRA`.
Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!
Version 1.6.49 [June 12, 2025]
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
Added various fixes and improvements to the build scripts and to
the sample code.
Version 1.6.50 [July 1, 2025]
Improved the detection of the RVV Extension on the RISC-V platform.
(Contributed by Filip Wasil)
Replaced inline ASM with C intrinsics in the RVV code.
(Contributed by Filip Wasil)
Fixed a decoder defect in which unknown chunks trailing IDAT, set
to go through the unknown chunk handler, incorrectly triggered
out-of-place IEND errors.
(Contributed by John Bowler)
Fixed the CMake file for cross-platform builds that require `libm`.
Version 1.6.51 [November 21, 2025]
Fixed CVE-2025-64505 (moderate severity):
Heap buffer overflow in `png_do_quantize` via malformed palette index.
(Reported by Samsung; analyzed by Fabio Gritti.)
Fixed CVE-2025-64506 (moderate severity):
Heap buffer over-read in `png_write_image_8bit` with 8-bit input and
`convert_to_8bit` enabled.
(Reported by Samsung and <weijinjinnihao@users.noreply.github.com>;
analyzed by Fabio Gritti.)
Fixed CVE-2025-64720 (high severity):
Buffer overflow in `png_image_read_composite` via incorrect palette
premultiplication.
(Reported by Samsung; analyzed by John Bowler.)
Fixed CVE-2025-65018 (high severity):
Heap buffer overflow in `png_combine_row` triggered via
`png_image_finish_read`.
(Reported by <yosiimich@users.noreply.github.com>.)
Fixed a memory leak in `png_set_quantize`.
(Reported by Samsung; analyzed by Fabio Gritti.)
Removed the experimental and incomplete ERROR_NUMBERS code.
(Contributed by Tobias Stoeckmann.)
Improved the RISC-V vector extension support; required RVV 1.0 or newer.
(Contributed by Filip Wasil.)
Added GitHub Actions workflows for automated testing.
Performed various refactorings and cleanups.
Version 1.6.52 [December 3, 2025]
Fixed CVE-2025-66293 (high severity):
Out-of-bounds read in `png_image_read_composite`.
(Reported by flyfish101 <flyfish101@users.noreply.github.com>.)
Fixed the Paeth filter handling in the RISC-V RVV implementation.
(Reported by Filip Wasil; fixed by Liang Junzhao.)
Improved the performance of the RISC-V RVV implementation.
(Contributed by Liang Junzhao.)
Added allocation failure fuzzing to oss-fuzz.
(Contributed by Philippe Antoine.)
Version 1.6.53 [December 5, 2025]
Fixed a build failure on RISC-V RVV caused by a misspelled intrinsic.
(Contributed by Alexander Smorkalov.)
Fixed a build failure with CMake 4.1 or newer, on Windows, when using
Visual C++ without MASM installed.
Version 1.6.54 [January 12, 2026]
Fixed CVE-2026-22695 (medium severity):
Heap buffer over-read in `png_image_read_direct_scaled`.
(Reported and fixed by Petr Simecek.)
Fixed CVE-2026-22801 (medium severity):
Integer truncation causing heap buffer over-read in `png_image_write_*`.
Implemented various improvements in oss-fuzz.
(Contributed by Philippe Antoine.)
Version 1.6.55 [February 9, 2026]
Fixed CVE-2026-25646 (high severity):
Heap buffer overflow in `png_set_quantize`.
(Reported and fixed by Joshua Inscoe.)
Resolved an oss-fuzz build issue involving nalloc.
(Contributed by Philippe Antoine.)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net. Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement <https://lists.sourceforge.net/lists/listinfo/png-mng-implement>
to subscribe. to subscribe.
This diff is collapsed.
This diff is collapsed.
...@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE ...@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2 PNG Reference Library License version 2
--------------------------------------- ---------------------------------------
* Copyright (c) 1995-2025 The PNG Reference Library Authors. * Copyright (c) 1995-2026 The PNG Reference Library Authors.
* Copyright (c) 2018-2025 Cosmin Truta. * Copyright (c) 2018-2026 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger. * Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
README for libpng version 1.6.47 README for libpng version 1.6.55
================================ ================================
See the note about version numbers near the top of `png.h`. See the note about version numbers near the top of `png.h`.
...@@ -24,14 +24,14 @@ for more things than just PNG files. You can use zlib as a drop-in ...@@ -24,14 +24,14 @@ for more things than just PNG files. You can use zlib as a drop-in
replacement for `fread()` and `fwrite()`, if you are so inclined. replacement for `fread()` and `fwrite()`, if you are so inclined.
zlib should be available at the same place that libpng is, or at zlib should be available at the same place that libpng is, or at
https://zlib.net . <https://zlib.net>.
You may also want a copy of the PNG specification. It is available You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html . these at <http://www.libpng.org/pub/png/pngdocs.html>.
This code is currently being archived at https://libpng.sourceforge.io This code is currently being archived at <https://libpng.sourceforge.io>
in the download area, and at http://libpng.download/src . in the download area, and at <http://libpng.download/src>.
This release, based in a large way on Glenn's, Guy's and Andreas' This release, based in a large way on Glenn's, Guy's and Andreas'
earlier work, was created and will be supported by myself and the PNG earlier work, was created and will be supported by myself and the PNG
...@@ -39,12 +39,12 @@ development group. ...@@ -39,12 +39,12 @@ development group.
Send comments, corrections and commendations to `png-mng-implement` Send comments, corrections and commendations to `png-mng-implement`
at `lists.sourceforge.net`. (Subscription is required; visit at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement <https://lists.sourceforge.net/lists/listinfo/png-mng-implement>
to subscribe.) to subscribe.)
Send general questions about the PNG specification to `png-mng-misc` Send general questions about the PNG specification to `png-mng-misc`
at `lists.sourceforge.net`. (Subscription is required; visit at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc <https://lists.sourceforge.net/lists/listinfo/png-mng-misc>
to subscribe.) to subscribe.)
Historical notes Historical notes
...@@ -147,6 +147,7 @@ Files included in this distribution ...@@ -147,6 +147,7 @@ Files included in this distribution
loongarch/ => Optimized code for LoongArch LSX loongarch/ => Optimized code for LoongArch LSX
mips/ => Optimized code for MIPS MSA and MIPS MMI mips/ => Optimized code for MIPS MSA and MIPS MMI
powerpc/ => Optimized code for PowerPC VSX powerpc/ => Optimized code for PowerPC VSX
riscv/ => Optimized code for the RISC-V platform
ci/ => Scripts for continuous integration ci/ => Scripts for continuous integration
contrib/ => External contributions contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform arm-neon/ => Optimized code for the ARM-NEON platform
...@@ -162,6 +163,7 @@ Files included in this distribution ...@@ -162,6 +163,7 @@ Files included in this distribution
programs demonstrating the use of pngusr.dfa programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images pngsuite/ => Test images
riscv-rvv/ => Optimized code for the RISC-V Vector platform
testpngs/ => Test images testpngs/ => Test images
tools/ => Various tools tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images visupng/ => VisualPng, a Windows viewer for PNG images
......
TODO list for libpng TODO list for libpng
-------------------- ====================
* Fix all defects (duh!) * Fix all defects (duh!)
* cHRM transformation. * cHRM transformation.
......
This diff is collapsed.
/* arm_init.c - NEON optimised filter functions
*
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* This module requires POSIX 1003.1 functions. */
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_OPT > 0
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the ARM
* NEON instructions there is no processor-specific way of detecting the
* presence of the required support, therefore run-time detection is extremely
* OS specific.
*
* You may set the macro PNG_ARM_NEON_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_neon function. There
* are a number of implementations in contrib/arm-neon, but the only one that
* has partial support is contrib/arm-neon/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
#include <signal.h> /* for sig_atomic_t */
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
static int png_have_neon(png_structp png_ptr);
#ifdef PNG_ARM_NEON_FILE
# include PNG_ARM_NEON_FILE
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
void
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
{
/* The switch statement is compiled in for ARM_NEON_API, the call to
* png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined
* the check is only performed if the API has not set the NEON option on
* or off explicitly. In this case the check controls what happens.
*
* If the CHECK is not compiled in and the option is UNSET the behavior prior
* to 1.6.7 was to use the NEON code - this was a bug caused by having the
* wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF,
* as documented in png.h
*/
png_debug(1, "in png_init_filter_functions_neon");
#ifdef PNG_ARM_NEON_API_SUPPORTED
switch ((pp->options >> PNG_ARM_NEON) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif /* PNG_ARM_NEON_API_SUPPORTED */
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_neon = -1; /* not checked */
if (no_neon < 0)
no_neon = !png_have_neon(pp);
if (no_neon)
return;
}
#ifdef PNG_ARM_NEON_API_SUPPORTED
break;
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifdef PNG_ARM_NEON_API_SUPPORTED
default: /* OFF or INVALID */
return;
case PNG_OPTION_ON:
/* Option turned on */
break;
}
#endif
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth4_neon;
}
}
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* READ */
/* filter_neon.S - placeholder file
*
* Copyright (c) 2024 Cosmin Truta
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* IMPORTANT NOTE:
*
* Historically, the hand-coded assembler implementation of Neon optimizations
* in this module had not been in sync with the intrinsics-based implementation
* in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
* the introduction of riffled palette optimizations. Moreover, the assembler
* code used to work on 32-bit ARM only, and it caused problems, even if empty,
* on 64-bit ARM.
*
* All references to this module from our internal build scripts and projects
* have been removed.
*
* For the external projects that might still expect this module to be present,
* we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
* Everything should continue to function normally, as long as there are no
* deliberate attempts to use the old hand-made assembler code. A build error
* will be raised otherwise.
*/
/* This is required to get the symbol renames, which are #defines, and the
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
#if PNG_ARM_NEON_OPT > 0
#if defined(__clang__)
#define GNUC_VERSION 0 /* not gcc, although it might pretend to be */
#elif defined(__GNUC__)
#define GNUC_MAJOR (__GNUC__ + 0)
#define GNUC_MINOR (__GNUC_MINOR__ + 0)
#define GNUC_PATCHLEVEL (__GNUC_PATCHLEVEL__ + 0)
#define GNUC_VERSION (GNUC_MAJOR * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL)
#else
#define GNUC_VERSION 0 /* not gcc */
#endif
#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
#elif GNUC_VERSION == 40504
#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
#else
#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
#endif
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
#endif /* READ */
This diff is collapsed.
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
*
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include "../pngpriv.h"
#if PNG_ARM_NEON_IMPLEMENTATION == 1
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
# include <arm64_neon.h>
#else
# include <arm_neon.h>
#endif
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
void
png_riffle_palette_neon(png_structrp png_ptr)
{
png_const_colorp palette = png_ptr->palette;
png_bytep riffled_palette = png_ptr->riffled_palette;
png_const_bytep trans_alpha = png_ptr->trans_alpha;
int num_trans = png_ptr->num_trans;
int i;
/* Initially black, opaque. */
uint8x16x4_t w = {{
vdupq_n_u8(0x00),
vdupq_n_u8(0x00),
vdupq_n_u8(0x00),
vdupq_n_u8(0xff),
}};
png_debug(1, "in png_riffle_palette_neon");
/* First, riffle the RGB colours into an RGBA8 palette.
* The alpha component is set to opaque for now.
*/
for (i = 0; i < 256; i += 16)
{
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
w.val[0] = v.val[0];
w.val[1] = v.val[1];
w.val[2] = v.val[2];
vst4q_u8(riffled_palette + (i << 2), w);
}
/* Fix up the missing transparency values. */
for (i = 0; i < num_trans; i++)
riffled_palette[(i << 2) + 3] = trans_alpha[i];
}
/* Expands a palettized row into RGBA8. */
int
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
const png_uint_32 *riffled_palette =
png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette);
const png_uint_32 pixels_per_chunk = 4;
png_uint_32 i;
png_debug(1, "in png_do_expand_palette_rgba8_neon");
PNG_UNUSED(row)
if (row_width < pixels_per_chunk)
return 0;
/* This function originally gets the last byte of the output row.
* The NEON part writes forward from a given position, so we have
* to seek this back by 4 pixels x 4 bytes.
*/
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
for (i = 0; i < row_width; i += pixels_per_chunk)
{
uint32x4_t cur;
png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
vst1q_u32((void *)dp, cur);
}
if (i != row_width)
{
/* Remove the amount that wasn't processed. */
i -= pixels_per_chunk;
}
/* Decrement output pointers. */
*ssp = *ssp - i;
*ddp = *ddp - (i << 2);
return i;
}
/* Expands a palettized row into RGB8. */
int
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
png_const_bytep palette = (png_const_bytep)png_ptr->palette;
const png_uint_32 pixels_per_chunk = 8;
png_uint_32 i;
png_debug(1, "in png_do_expand_palette_rgb8_neon");
PNG_UNUSED(row)
if (row_width <= pixels_per_chunk)
return 0;
/* Seeking this back by 8 pixels x 3 bytes. */
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
for (i = 0; i < row_width; i += pixels_per_chunk)
{
uint8x8x3_t cur;
png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
vst3_u8((void *)dp, cur);
}
if (i != row_width)
{
/* Remove the amount that wasn't processed. */
i -= pixels_per_chunk;
}
/* Decrement output pointers. */
*ssp = *ssp - i;
*ddp = *ddp - ((i << 1) + i);
return i;
}
#endif /* PNG_ARM_NEON_IMPLEMENTATION */
#! /bin/sh
#
# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
# control files.
#
# The first time this is run on a GIT checkout the only files that exist are
# configure.ac and Makefile.am; all of the autotools support scripts are
# missing. They are instantiated with autoreconf --force --install.
#
# For regular ("tarball") distributions all the files should exist. We do not
# want them to be updated *under any circumstances*. It should never be
# necessary to run autogen.sh because ./configure --enable-maintainer-mode says
# what to do if Makefile.am or configure.ac are changed.
#
# It is *probably* OK to update the files on a GIT checkout, because they have
# come from the local tools, but leave that to the user who is assumed to know
# whether it is ok or required.
#
# This script is intended to work without arguments, there are, however, hidden
# arguments (a) for use while testing the script and (b) to fix up systems that
# have been broken. If (b) is required the script prompts for the correct
# options. For this reason the options are *NOT* documented in the help; this
# is deliberate; UTSL.
#
clean=
maintainer=
while test $# -gt 0
do
case "$1" in
--maintainer)
maintainer=1;;
--clean)
clean=1;;
*)
exec >&2
echo "$0: usage: ./autogen.sh"
if test -d .git
then
echo " ./autogen.sh generates the configure script and"
echo " Makefile.in, or refreshes them after changes to Makefile.am"
echo " or configure.ac. You may prefer to just run autoreconf."
elif test -z "$maintainer"
then
echo " DO NOT RUN THIS SCRIPT."
echo " If you need to change Makefile.am or configure.ac then you"
echo " also need to run ./configure --enable-maintainer-mode and"
echo " use the appropriate autotools, *NOT* this script, to update"
echo " everything, please check the documentation of autoreconf."
echo " WARNING: libpng is intentionally generated with a known,"
echo " fixed, set of autotools. It is known *NOT* to work with"
echo " the collection of autotools distributed on highly reputable"
echo " operating systems."
echo " Remember: autotools is GNU software, you are expected to"
echo " pay for support."
else
echo " You have run autogen.sh with --maintainer enabled and you"
echo " are not using a GIT distribution, then you have given an"
echo " unrecognized argument. This is not good. --maintainer"
echo " switches off any assumptions that you might not know what"
echo " you are doing."
fi
exit 1;;
esac
shift
done
#
# First check for a set of the autotools files; if absent then this is assumed
# to be a GIT version and the local autotools must be used. If present this
# is a tarball distribution and the script should not be used. If partially
# present bad things are happening.
#
# The autotools generated files:
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
config.sub configure depcomp install-sh ltmain.sh missing\
test-driver"
#
# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
# versions than those required by configure.ac):
libpng_autotools_extra="compile config.h.in~"
#
# These are separate because 'maintainer-clean' does not remove them.
libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
scripts/autoconf/lt~obsolete.m4"
libpng_autotools_dirs="autom4te.cache" # not required
#
# The configure generated files:
libpng_configure_files="Makefile config.h config.log config.status\
libpng-config libpng.pc libtool stamp-h1"
libpng_configure_dirs=".deps"
#
# We must remove the configure generated files as well as the autotools
# generated files if autotools are regenerated because otherwise if configure
# has been run without "--enable-maintainer-mode" make can do a partial update
# of Makefile. These functions do the two bits of cleaning.
clean_autotools(){
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
rm -rf $libpng_autotools_extra
}
clean_configure(){
rm -rf $libpng_configure_files $libpng_configure_dirs
}
#
# Clean: remove everything (this is to help with testing)
if test -n "$clean"
then
clean_configure
if test -n "$maintainer"
then
clean_autotools
fi
exit 0
fi
#
# Validate the distribution.
libpng_autotools_file_found=
libpng_autotools_file_missing=
for file in $libpng_autotools_files
do
if test -f "$file"
then
libpng_autotools_file_found=1
else
libpng_autotools_file_missing=1
fi
done
#
# Presence of one of these does not *invalidate* missing, but absence
# invalidates found.
for file in $libpng_libtool_files
do
if test ! -f "$file"
then
libpng_autotools_file_missing=1
fi
done
#
# The cache directory doesn't matter - it will be regenerated and does not exist
# anyway in a tarball.
#
# Either everything is missing or everything is there, the --maintainer option
# just changes this so that the mode is set to generate all the files.
mode=
if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
then
mode="autoreconf"
else
if test -n "$libpng_autotools_file_missing"
then
mode="broken"
else
mode="configure"
fi
fi
#
# So:
case "$mode" in
autoreconf)
# Clean in case configure files exist
clean_configure
clean_autotools
# Everything must be initialized, so use --force
if autoreconf --warnings=all --force --install
then
missing=
for file in $libpng_autotools_files
do
test -f "$file" || missing=1
done
# ignore the cache directory
test -z "$missing" || {
exec >&2
echo "autoreconf was run, but did not produce all the expected"
echo "files. It is likely that your autotools installation is"
echo "not compatible with that expected by libpng."
exit 1
}
else
exec >&2
echo "autoreconf failed: your version of autotools is incompatible"
echo "with this libpng version. Please use a distributed archive"
echo "(which includes the autotools generated files) and run configure"
echo "instead."
exit 1
fi;;
configure)
if test -d .git
then
exec >&2
echo "ERROR: running autoreconf on an initialized system"
echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:"
echo
echo " ./configure --enable-maintainer-mode."
echo
echo " You can run autoreconf yourself if you don't like maintainer"
echo " mode and you can also just run autoreconf -f -i to initialize"
echo " everything in the first place; this script is only for"
echo " compatibility with prior releases."
exit 1
else
exec >&2
echo "autogen.sh is intended only to generate 'configure' on systems"
echo "that do not have it. You have a complete 'configure', if you"
echo "need to change Makefile.am or configure.ac you also need to"
echo "run configure with the --enable-maintainer-mode option."
exit 1
fi;;
broken)
exec >&2
echo "Your system has a partial set of autotools generated files."
echo "autogen.sh is unable to proceed. The full set of files is"
echo "contained in the libpng 'tar' distribution archive and you do"
echo "not need to run autogen.sh if you use it."
exit 1;;
esac
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the 'feenableexcept' function. */
#undef HAVE_FEENABLEEXCEPT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the 'm' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the 'z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the 'pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Turn on ARM Neon optimizations at run-time */
#undef PNG_ARM_NEON_API_SUPPORTED
/* Check for ARM Neon support at run-time */
#undef PNG_ARM_NEON_CHECK_SUPPORTED
/* Enable ARM Neon optimizations */
#undef PNG_ARM_NEON_OPT
/* Enable Intel SSE optimizations */
#undef PNG_INTEL_SSE_OPT
/* Enable LOONGARCH LSX optimizations */
#undef PNG_LOONGARCH_LSX_OPT
/* Turn on MIPS MMI optimizations at run-time */
#undef PNG_MIPS_MMI_API_SUPPORTED
/* Check for MIPS MMI support at run-time */
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
/* Enable MIPS MMI optimizations */
#undef PNG_MIPS_MMI_OPT
/* Turn on MIPS MSA optimizations at run-time */
#undef PNG_MIPS_MSA_API_SUPPORTED
/* Check for MIPS MSA support at run-time */
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
/* Enable MIPS MSA optimizations */
#undef PNG_MIPS_MSA_OPT
/* Turn on POWERPC VSX optimizations at run-time */
#undef PNG_POWERPC_VSX_API_SUPPORTED
/* Check for POWERPC VSX support at run-time */
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
/* Enable POWERPC VSX optimizations */
#undef PNG_POWERPC_VSX_OPT
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported only directly. */
#undef restrict
/* Work around a bug in older versions of Sun C++, which did not
#define __restrict__ or support _Restrict or __restrict__
even though the corresponding Sun C compiler ended up with
"#define restrict _Restrict" or "#define restrict __restrict__"
in the previous line. This workaround can be removed once
we assume Oracle Developer Studio 12.5 (2016) or later. */
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* example.c - an example of using libpng /* example.c - an example of using libpng
* *
* Maintained 2018-2024 Cosmin Truta * Maintained 2018-2025 Cosmin Truta
* Maintained 1998-2016 Glenn Randers-Pehrson * Maintained 1998-2016 Glenn Randers-Pehrson
* Maintained 1996-1997 Andreas Dilger * Maintained 1996-1997 Andreas Dilger
* Written 1995-1996 Guy Eric Schalnat, Group 42, Inc. * Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
...@@ -179,11 +179,11 @@ int main(int argc, const char **argv) ...@@ -179,11 +179,11 @@ int main(int argc, const char **argv)
* components. * components.
* *
* You do not have to read directly from a file. You can read from memory or, * You do not have to read directly from a file. You can read from memory or,
* on systems that support it, from a <stdio.h> FILE*. This is controlled by * on systems that support <stdio.h>, from a FILE object. This is controlled
* the particular png_image_read_from_ function you call at the start. * by the particular png_image_begin_read_from_ function you call at the start.
* Likewise, on write, you can write to a FILE* if your system supports it. * Likewise, on write, you can write to a FILE object if your system supports
* Check the macro PNG_STDIO_SUPPORTED to see if stdio support has been * <stdio.h>. The macro PNG_STDIO_SUPPORTED indicates if stdio is available
* included in your libpng build. * and accessible from your libpng build.
* *
* If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it * If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it
* in the 8-bit format for display. You do this by setting the convert_to_8bit * in the 8-bit format for display. You do this by setting the convert_to_8bit
......
This diff is collapsed.
This diff is collapsed.
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 2018-2026 Cosmin Truta
Copyright (c) 1998-2018 Glenn Randers-Pehrson Copyright (c) 1998-2018 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
...@@ -9,9 +9,9 @@ libpng-manual.txt - A description on how to use and modify libpng ...@@ -9,9 +9,9 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng version 1.6.36, December 2018, through 1.6.47 - February 2025 libpng version 1.6.36, December 2018, through 1.6.55 - February 2026
Updated and distributed by Cosmin Truta Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta Copyright (c) 2018-2026 Cosmin Truta
libpng versions 0.97, January 1998, through 1.6.35 - July 2018 libpng versions 0.97, January 1998, through 1.6.35 - July 2018
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
...@@ -65,18 +65,22 @@ Libpng was written as a companion to the PNG specification, as a way ...@@ -65,18 +65,22 @@ Libpng was written as a companion to the PNG specification, as a way
of reducing the amount of time and effort it takes to support the PNG of reducing the amount of time and effort it takes to support the PNG
file format in application programs. file format in application programs.
The PNG specification (second edition), November 2003, is available as The PNG specification (Third Edition), June 2025, is available as
a W3C Recommendation at
<https://www.w3.org/TR/2025/REC-png-3-20250624/>.
The PNG specification (Second Edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
<https://www.w3.org/TR/2003/REC-PNG-20031110/>. <https://www.w3.org/TR/2003/REC-PNG-20031110/>.
The W3C and ISO documents have identical technical content. The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at The PNG-1.2 specification is available at
<https://png-mng.sourceforge.io/pub/png/spec/1.2/>. <https://www.libpng.org/pub/png/spec/1.2/>.
It is technically equivalent It is technically equivalent to the PNG specification (Second Edition)
to the PNG specification (second edition) but has some additional material. but has some additional material.
The PNG-1.0 specification is available as RFC 2083 at The PNG-1.0 specification is available as RFC 2083 at
<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a <https://www.libpng.org/pub/png/spec/1.0/> and as a
W3C Recommendation at <https://www.w3.org/TR/REC-png-961001>. W3C Recommendation at <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks Some additional chunks are described in the special-purpose public chunks
...@@ -3351,19 +3355,6 @@ Here is an example of writing two private chunks, prVt and miNE: ...@@ -3351,19 +3355,6 @@ Here is an example of writing two private chunks, prVt and miNE:
/* Needed because miNE is not safe-to-copy */ /* Needed because miNE is not safe-to-copy */
png_set_keep_unknown_chunks(png, PNG_HANDLE_CHUNK_ALWAYS, png_set_keep_unknown_chunks(png, PNG_HANDLE_CHUNK_ALWAYS,
(png_bytep) "miNE", 1); (png_bytep) "miNE", 1);
# if PNG_LIBPNG_VER < 10600
/* Deal with unknown chunk location bug in 1.5.x and earlier */
png_set_unknown_chunk_location(png, info, 0, PNG_HAVE_IHDR);
png_set_unknown_chunk_location(png, info, 1, PNG_AFTER_IDAT);
# endif
# if PNG_LIBPNG_VER < 10500
/* PNG_AFTER_IDAT writes two copies of the chunk prior to libpng-1.5.0,
* one before IDAT and another after IDAT, so don't use it; only use
* PNG_HAVE_IHDR location. This call resets the location previously
* set by assignment and png_set_unknown_chunk_location() for chunk 1.
*/
png_set_unknown_chunk_location(png, info, 1, PNG_HAVE_IHDR);
# endif
#endif #endif
The high-level write interface The high-level write interface
...@@ -4089,7 +4080,7 @@ READ APIs ...@@ -4089,7 +4080,7 @@ READ APIs
is filled in from the PNG header in the file. is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image, int png_image_begin_read_from_stdio (png_imagep image,
FILE* file) FILE *file)
The PNG header is read from the stdio FILE object. The PNG header is read from the stdio FILE object.
...@@ -4164,7 +4155,7 @@ be written: ...@@ -4164,7 +4155,7 @@ be written:
int convert_to_8_bit, const void *buffer, int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap) png_int_32 row_stride, const void *colormap)
Write the image to the given (FILE*). Write the image to the given FILE object.
With all write APIs if image is in one of the linear formats with With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be (png_uint_16) data then setting convert_to_8_bit will cause the output to be
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment