diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-03-12 22:35:20 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-03-14 07:16:06 +0100 |
commit | 1091963d3898eac8aaf8402dc5a5f9867ba96bd1 (patch) | |
tree | 9fc331e4f6dd36514ea22abc7343774030144459 /libavfilter/vf_ssim360.c | |
parent | 4175022bdb958597d8d73e803bc18d0da93c46c3 (diff) | |
download | ffmpeg-1091963d3898eac8aaf8402dc5a5f9867ba96bd1.tar.gz |
avfilter/vf_ssim360: Use correct type in sizeof
SSIM360Context.ssim360_hist is an array of four pointers to double;
so sizeof(*ssim360_hist[0]) (=sizeof(double)) is the correct size
to use to calculate the amount of memory to allocate, not
sizeof(*ssim360_hist) (which is sizeof(double*)).
Use FF_ALLOCZ_TYPED_ARRAY to avoid this issue altogether.
Fixes Coverity issue #1520671.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_ssim360.c')
-rw-r--r-- | libavfilter/vf_ssim360.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c index 3eb8e43bbc..f8ce0744f2 100644 --- a/libavfilter/vf_ssim360.c +++ b/libavfilter/vf_ssim360.c @@ -1624,7 +1624,7 @@ static int config_output(AVFilterLink *outlink) memset(s->ssim360_percentile_sum, 0, sizeof(s->ssim360_percentile_sum)); for (int i = 0; i < s->nb_components; i++) { - s->ssim360_hist[i] = av_calloc(SSIM360_HIST_SIZE, sizeof(*s->ssim360_hist)); + FF_ALLOCZ_TYPED_ARRAY(s->ssim360_hist[i], SSIM360_HIST_SIZE); if (!s->ssim360_hist[i]) return AVERROR(ENOMEM); } |