diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4116f340d9371d2c9d046b1b0d44d0ac90659071..e987d876e98e202b05580715d812bbcd5fb434be 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1761,7 +1761,7 @@ void ff_MPV_frame_end(MpegEncContext *s)
             break;
         }
     }
-    assert(i < MAX_PICTURE_COUNT);
+    av_assert0(i < MAX_PICTURE_COUNT);
 #endif
 
     // clear copies, to avoid confusion