xbmc/lib/cximage-6.0/CxImage/ximapng.{cpp,h} use png_struct_def directly when setting up a customer error handler:
ximapng.cpp
Code:
png_set_error_fn(png_ptr,info.szLastError,/*(png_error_ptr)*/user_error_fn,NULL);ximapng.h
Code:
static void PNGAPI user_error_fn(png_structp png_ptr,png_const_charp error_msg)
{
strncpy((char*)png_ptr->error_ptr,error_msg,255);
longjmp(png_ptr->jmpbuf, 1);
}Its not entirely clear what is going on here - it looks like user_error_fn() is setup to pretty much reproduce png_error(), but without displaying any message to stderr. What is curious is that the png_set_error_fn() only ovverrides png_warning(), not png_error(), so any call to png_warning() will still be echoing content to stderr, plus ximapng.h calls png_error() directly in some cases.
Am I missing anything obvious where - why is user_error_fn() needed at all?
Thanks

Search
Help