From a9ec618831d7292071498a2469a49ce6ca2bb1b1 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Mon, 21 Sep 2009 15:07:47 +0200 Subject: [PATCH] [AdgMarker] Avoid get_segment() when n_segment == 0 It is allowed to set the n_segment to 0, while finalizing the marker for instance: in this situation the call to adg_trail_get_segment() should not happen. --- adg/adg-marker.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adg/adg-marker.c b/adg/adg-marker.c index e4cab6be..f313b90c 100644 --- a/adg/adg-marker.c +++ b/adg/adg-marker.c @@ -661,6 +661,11 @@ set_n_segment(AdgMarker *marker, guint n_segment) data->n_segment = n_segment; + if (n_segment == 0) { + memset(&data->segment, 0, sizeof(data->segment)); + return TRUE; + } + return adg_trail_get_segment(data->trail, &data->segment, n_segment); } -- 2.11.4.GIT