Malformed or suspicious input files can cause std::exceptions by
vector<>.reserve() calls. Now they are caught to avoid crashes or other
vulnerabilities.
One of the most intrusive changes in QGIS' fork was that the debugging code was replaced with hardcoded changes to redirect the output to QGIS' internal logging mechanism. In this PR I've setup an interface to allow clients to create custom output debugging classes and assign these to be used by the library.
This will allow me to remove all the related downstream changes in QGIS' fork and re-sync these files back to upstream.
Interface for debug printers.