Author: Vincent LaBella <vlabella@albany.edu>
Description: qgle: eliminate stackunderflow -17 ghostscript error when rendering with gs library
Acked-by: Christian T. Steigies <cts@debian.org>
Last-Update: 2025-10-15
Index: gle-graphics/src/gui/qgs.cpp
===================================================================
--- gle-graphics.orig/src/gui/qgs.cpp
+++ gle-graphics/src/gui/qgs.cpp
@@ -479,6 +479,8 @@ bool GSInterpreterLib::run(const string*
 		offset += readNow;
 		toRead -= readNow;
 	}
+	return_code = m_gs->gsapi_run_string_continue(ghostScriptInstance,"quit", 4, 0, &exit_code);
+	if (exit_code && !handleExit(exit_code)) return false;
 	return_code = m_gs->gsapi_run_string_end(ghostScriptInstance, 0, &exit_code);
 	if (exit_code && !handleExit(exit_code)) return false;
 	return true;
