diff --git a/src/search.c b/src/search.c
index c986d48..03ac07a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -635,8 +635,12 @@
       if (offset == (size_t) -1)
    goto failure;
 #ifdef MBS_SUPPORT
+      char const *s_in = mb_start;
       if (MB_CUR_MAX > 1 && is_mb_middle (&mb_start, beg + offset, buf + size))
         {
+          if (mb_start == s_in)
+            goto failure;
+
           beg = mb_start - 1;
           continue; /* It is a part of multibyte character.  */
         }
