summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:35:26 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:35:26 +0200
commit23462e769c604d3deebb85190f929bf2f7f719e2 (patch)
treebfec48915c8b5f847002d591a524be21f4e3b8e8
parent9b65046df7f53e477f0b6ba3bf61a069178061d4 (diff)
downloadcv-23462e769c604d3deebb85190f929bf2f7f719e2.tar.gz
cv-23462e769c604d3deebb85190f929bf2f7f719e2.tar.bz2
cv-23462e769c604d3deebb85190f929bf2f7f719e2.zip
roi: Fail if invalid or no image is given
-rw-r--r--roi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/roi.c b/roi.c
index 9192472..eac03d9 100644
--- a/roi.c
+++ b/roi.c
@@ -237,7 +237,11 @@ main(int argc, char *argv[])
gtk_init(&argc, &argv);
+ if (argc < 2)
+ exit(EXIT_FAILURE);
roi.input = gdk_pixbuf_new_from_file(argv[1], NULL);
+ if (!roi.input)
+ exit(EXIT_FAILURE);
roi.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
roi.drawing_area = gtk_drawing_area_new();