diff --git a/gstlal-inspiral/lib/gstlal_snglinspiral.c b/gstlal-inspiral/lib/gstlal_snglinspiral.c
index 22cddf40829a4b35f22b3889c5a1963884f1b5e0..2277f9016f92a69923255321101df018983fcaf0 100644
--- a/gstlal-inspiral/lib/gstlal_snglinspiral.c
+++ b/gstlal-inspiral/lib/gstlal_snglinspiral.c
@@ -234,7 +234,7 @@ GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *in
 			XLALGPSAddGPS(&event->epoch, &parent->end);
 			parent->end = event->epoch;
 			XLALGPSAdd(&parent->end, (double) input->interpsamples[channel] / rate);
-			XLALGPSAdd(&event->epoch, (double) (input->samples[channel] - input->pad) / rate);
+			XLALGPSAdd(&event->epoch, ((gint) input->samples[channel] - (gint) input->pad) / (double) rate);
 			event->deltaT = 1. / rate;
 
 			parent->end_time_gmst = XLALGreenwichMeanSiderealTime(&parent->end);