lavfi: fix realloc size computation in avfilter_add_format()

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>
This commit is contained in:
Stefano Sabatini 2011-06-19 22:07:18 +02:00 committed by Anton Khirnov
parent e63e4c99c9
commit 0ec56d1144
1 changed files with 1 additions and 1 deletions

View 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);