{"record":{"id":"6adc536a0d1f0bc5","repo":"openjdk/jdk","slug":"libpng-error-s","errorCode":null,"errorMessage":"libpng error: %s","messagePattern":"libpng error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/java.desktop/share/native/libsplashscreen/libpng/pngerror.c","lineNumber":691,"sourceCode":"      /* *Always* cancel everything out: */\n      png_ptr->jmp_buf_size = 0;\n      png_ptr->jmp_buf_ptr = NULL;\n      png_ptr->longjmp_fn = 0;\n   }\n}\n#endif\n\n/* This is the default error handling function.  Note that replacements for\n * this function MUST NOT RETURN, or the program will likely crash.  This\n * function is used by default, or if the program supplies NULL for the\n * error function pointer in png_set_error_fn().\n */\nstatic PNG_FUNCTION(void /* PRIVATE */,\npng_default_error,(png_const_structrp png_ptr, png_const_charp error_message),\n    PNG_NORETURN)\n{\n#ifdef PNG_CONSOLE_IO_SUPPORTED\n   fprintf(stderr, \"libpng error: %s\", error_message ? error_message :\n      \"undefined\");\n   fprintf(stderr, PNG_STRING_NEWLINE);\n#else\n   PNG_UNUSED(error_message) /* Make compiler happy */\n#endif\n   png_longjmp(png_ptr, 1);\n}\n\nPNG_FUNCTION(void,PNGAPI\npng_longjmp,(png_const_structrp png_ptr, int val),\n    PNG_NORETURN)\n{\n#ifdef PNG_SETJMP_SUPPORTED\n   if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&\n       png_ptr->jmp_buf_ptr != NULL)\n      png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);\n#else\n   PNG_UNUSED(png_ptr)","sourceCodeStart":673,"sourceCodeEnd":709,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/java.desktop/share/native/libsplashscreen/libpng/pngerror.c#L673-L709","documentation":"libpng's default fatal-error handler, compiled into the JDK splashscreen. When libpng hits an unrecoverable condition (bad signature, invalid chunk CRC, malformed IHDR, out-of-memory in a png_malloc), png_default_error prints 'libpng error: <message>' and immediately png_longjmps back into the splash code's setjmp point — the function must not return. In the splashscreen context this aborts loading of the splash image.","triggerScenarios":"Passing a -splash:/-splash: image (via java -splash, jar manifest SplashScreen-Image, or JavaWS) that is corrupt, truncated, has a bad PNG signature/CRC, or uses an unsupported PNG feature. The bundled libpng parses it in native code at JVM/launcher startup or at SplashScreen.setImage() time.","commonSituations":"PNG truncated by a build pipeline or a partial git checkout; an image that is actually JPEG/GIF renamed to .png; PNGs written by exotic encoders with unusual chunks or 16-bit depths; download corruption of a packaged app. The splash silently fails and the app usually still starts.","solutions":["Validate the PNG outside the app: 'pngcheck image.png' or open it in a browser/image editor","Re-export the splash image with a mainstream tool as 8-bit RGB(A) PNG","Confirm the manifest SplashScreen-Image path points at the right file inside the jar (case-sensitive, no leading slash issues)","If the image is fine, ensure it was not recompressed/patched by deployment tooling (e.g. reproducible-build byte patching)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify PNG signature before shipping/using as splash\nbyte[] p = Files.readAllBytes(Path.of(\"splash.png\"));\nbyte[] SIG = {(byte)0x89,'P','N','G','\\r','\\n',0x1A,'\\n'};\nif (!Arrays.equals(Arrays.copyOfRange(p,0,8), SIG)) throw new IOException(\"not a PNG\");\n// plus run pngcheck in CI: pngcheck -q splash.png","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run pngcheck on splash assets in CI so corrupt PNGs fail the build, not the launch","Keep splash images as 8-bit RGB/RGBA exported from a mainstream tool","Never rename non-PNG files to .png for the splash"],"tags":["png","libpng","splashscreen","image-decoding","native"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}