diff --git a/src/vtestream-file.h b/src/vtestream-file.h
index 8e7485a..0427bc1 100644
--- a/src/vtestream-file.h
+++ b/src/vtestream-file.h
@@ -464,6 +464,8 @@ _vte_file_stream_advance_tail (VteStream *astream, gsize offset)
 {
 	VteFileStream *stream = (VteFileStream *) astream;
 
+	g_assert(offset <= stream->head);
+
 	if (offset >= stream->offset[0]) {
 		stream->offset[1] = stream->offset[0];
 		stream->offset[0] = stream->head;
