diff --git a/libswresample/resample.c b/libswresample/resample.c
index cef2a8173464bbcea50323f0de091dc5ae1b93b4..7a5c7d73b330d5fcaa370cd6a3e6b89f2ffae489 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -78,6 +78,7 @@ static double bessel(double x){
         lastv=v;
         t *= x*inv[i];
         v += t;
+        av_assert2(i<99);
     }
     return v;
 }