Author: Martin Guy <martinwguy@gmail.com>
Date:   Sat Jul 19 10:45:29 2014 +0000

    Give non-zero exit status on cairo errors

diff --git a/src/spectrogram.c b/src/spectrogram.c
index 934315f..1d80c3d 100644
--- a/src/spectrogram.c
+++ b/src/spectrogram.c
@@ -657,7 +657,7 @@ render_cairo_surface (const RENDER * render, SNDFILE *infile, int samplerate, sf
 	if (surface == NULL || cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
 	{	status = cairo_surface_status (surface) ;
 		printf ("Error while creating surface : %s\n", cairo_status_to_string (status)) ;
-		return ;
+		exit(1) ;
 		} ;
 
 	cairo_surface_flush (surface) ;
@@ -666,7 +666,9 @@ render_cairo_surface (const RENDER * render, SNDFILE *infile, int samplerate, sf
 
 	status = cairo_surface_write_to_png (surface, render->pngfilepath) ;
 	if (status != CAIRO_STATUS_SUCCESS)
-		printf ("Error while creating PNG file : %s\n", cairo_status_to_string (status)) ;
+	{	printf ("Error while creating PNG file : %s\n", cairo_status_to_string (status)) ;
+		exit(1) ;
+		} ;
 
 	cairo_surface_destroy (surface) ;
 
@@ -681,7 +683,7 @@ render_sndfile (const RENDER * render)
 
 	if (render->log_freq)
 	{	printf ("Error : --log-freq option not working yet.\n\n") ;
-		return ;
+		exit(1) ;
 		} ;
 
 	memset (&info, 0, sizeof (info)) ;
@@ -689,7 +691,7 @@ render_sndfile (const RENDER * render)
 	infile = sf_open (render->sndfilepath, SFM_READ, &info) ;
 	if (infile == NULL)
 	{	printf ("Error : failed to open file '%s' : \n%s\n", render->sndfilepath, sf_strerror (NULL)) ;
-		return ;
+		exit(1) ;
 		} ;
 
 	render_cairo_surface (render, infile, info.samplerate, info.frames) ;
