From 8f349b64813b348634042d96b9d104ada94dc538 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 19 Jun 2011 22:07:18 +0200 Subject: [PATCH] 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 *). --- libavfilter/formats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 58593fcce..4a23c2f1b 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -99,7 +99,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); -- 2.11.0