avfilter/formats: use av_realloc_array in ADD_FORMAT()
[ffmpeg.git] / libavfilter / formats.c
index 1fc7fa6..896ceeb 100644 (file)
@@ -308,8 +308,8 @@ do {                                                        \
     if (!(*f) && !(*f = av_mallocz(sizeof(**f))))           \
         return AVERROR(ENOMEM);                             \
                                                             \
-    fmts = av_realloc((*f)->list,                           \
-                      sizeof(*(*f)->list) * ((*f)->nb + 1));\
+    fmts = av_realloc_array((*f)->list, (*f)->nb + 1,       \
+                            sizeof(*(*f)->list));           \
     if (!fmts) {                                            \
         if (!oldf)                                          \
             av_freep(f);                                    \