lavfi: fix realloc size computation in avfilter_add_format()
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 19 Jun 2011 20:07:18 +0000 (22:07 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 28 Sep 2011 06:03:18 +0000 (08:03 +0200)
Replace sizeof((*avff)->formats)
with    sizeof(*(*avff)->formats)

as the size of the array element is given by the pointed element
rather than by its pointer.

In particular fix computation with the pending patch when
sizeof(int64_t) != sizeof(int64_t *).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavfilter/formats.c

index bb7b921..ae916cf 100644 (file)
@@ -94,7 +94,7 @@ int avfilter_add_format(AVFilterFormats **avff, int fmt)
         return AVERROR(ENOMEM);
 
     fmts = av_realloc((*avff)->formats,
-                      sizeof((*avff)->formats) * ((*avff)->format_count+1));
+                      sizeof(*(*avff)->formats) * ((*avff)->format_count+1));
     if (!fmts)
         return AVERROR(ENOMEM);