aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-08-06 14:58:13 +0200
committerPaul B Mahol <onemda@gmail.com>2015-08-06 15:06:14 +0200
commit40ddbc87c5cd1a4285e75482688b41d9bbcf5225 (patch)
treef16581beeb261d8b71b43c72f5280df6c07b067a
parentcb5190bc9df3261ecc70223c24aa07699dcb9f79 (diff)
downloadffmpeg-40ddbc87c5cd1a4285e75482688b41d9bbcf5225.tar.gz
avfilter/avf_showspectrum: use av_calloc()
-rw-r--r--libavfilter/avf_showspectrum.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 73c783f04e..e29687d8ba 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -172,7 +172,6 @@ static int config_output(AVFilterLink *outlink)
/* (re-)configuration if the video output changed (or first init) */
if (rdft_bits != s->rdft_bits) {
- size_t rdft_size, rdft_listsize;
AVFrame *outpicref;
av_rdft_end(s->rdft);
@@ -192,17 +191,11 @@ static int config_output(AVFilterLink *outlink)
av_freep(&s->rdft_data);
s->nb_display_channels = inlink->channels;
- if (av_size_mult(sizeof(*s->rdft_data),
- s->nb_display_channels, &rdft_listsize) < 0)
- return AVERROR(EINVAL);
- if (av_size_mult(sizeof(**s->rdft_data),
- win_size, &rdft_size) < 0)
- return AVERROR(EINVAL);
- s->rdft_data = av_malloc(rdft_listsize);
+ s->rdft_data = av_calloc(s->nb_display_channels, sizeof(*s->rdft_data));
if (!s->rdft_data)
return AVERROR(ENOMEM);
for (i = 0; i < s->nb_display_channels; i++) {
- s->rdft_data[i] = av_malloc(rdft_size);
+ s->rdft_data[i] = av_calloc(win_size, sizeof(**s->rdft_data));
if (!s->rdft_data[i])
return AVERROR(ENOMEM);
}