diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 07ecd32ab361481209039d44aac77ecaa9cf0cbc..87573d7cf0dfde76d6d5e5a99f7c955259c58fb2 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/dict.h"
@@ -832,7 +833,7 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
 {
     RMDemuxContext *rm = s->priv_data;
 
-    assert (rm->audio_pkt_cnt > 0);
+    av_assert0 (rm->audio_pkt_cnt > 0);
 
     if (ast->deint_id == DEINT_ID_VBRF ||
         ast->deint_id == DEINT_ID_VBRS)