summaryrefslogtreecommitdiff
path: root/libspectre
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-04-06 17:24:59 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2010-04-06 17:24:59 +0200
commitce55aa1110f3b933943a92ecd0a948d017cdb492 (patch)
treef5d85d74470f9fd856e6c011a3017c56843b4b6b /libspectre
parent35aa9dfac2631de24a40d95d1469acb52f379249 (diff)
Fix a crash in pdf exporter when rendering fails
Diffstat (limited to 'libspectre')
-rw-r--r--libspectre/spectre-exporter-pdf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libspectre/spectre-exporter-pdf.c b/libspectre/spectre-exporter-pdf.c
index 3b6beee..c763f7f 100644
--- a/libspectre/spectre-exporter-pdf.c
+++ b/libspectre/spectre-exporter-pdf.c
@@ -93,6 +93,9 @@ spectre_exporter_pdf_do_page (SpectreExporter *exporter,
{
struct document *doc = exporter->doc;
+ if (!exporter->gs)
+ return SPECTRE_STATUS_EXPORTER_ERROR;
+
if (!spectre_gs_process (exporter->gs,
doc->filename,
0, 0,
@@ -113,6 +116,9 @@ spectre_exporter_pdf_end (SpectreExporter *exporter)
int ret;
struct document *doc = exporter->doc;
+ if (!exporter->gs)
+ return SPECTRE_STATUS_EXPORTER_ERROR;
+
ret = spectre_gs_process (exporter->gs,
doc->filename,
0, 0,