[FFmpeg-cvslog] lavfi: fix realloc size computation in avfilter_add_format()

Stefano Sabatini git at videolan.org
Sun Jun 19 23:05:31 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sun Jun 19 22:07:18 2011 +0200| [8f349b64813b348634042d96b9d104ada94dc538] | committer: Stefano Sabatini

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 *).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f349b64813b348634042d96b9d104ada94dc538
---

 libavfilter/formats.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 58593fc..4a23c2f 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);
 



More information about the ffmpeg-cvslog mailing list