aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-17 16:33:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-17 18:00:25 +0200
commitdca22ab055bd19a49c173c49fc0a8db7be442044 (patch)
tree23306a8f485ef3217245596af1537533ba07da93
parentad516dd271ff4557c441895ca8cb16a182c064e9 (diff)
downloadffmpeg-dca22ab055bd19a49c173c49fc0a8db7be442044.tar.gz
avcodec/resample: Use av_m/realloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/resample.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index f9502880e0..7c0f828be2 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -347,10 +347,10 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
/* XXX: move those malloc to resample init code */
for (i = 0; i < s->filter_channels; i++) {
- bufin[i] = av_malloc((nb_samples + s->temp_len) * sizeof(short));
+ bufin[i] = av_malloc_array((nb_samples + s->temp_len), sizeof(short));
memcpy(bufin[i], s->temp[i], s->temp_len * sizeof(short));
buftmp2[i] = bufin[i] + s->temp_len;
- bufout[i] = av_malloc(lenout * sizeof(short));
+ bufout[i] = av_malloc_array(lenout, sizeof(short));
}
if (s->input_channels == 2 && s->output_channels == 1) {
@@ -384,7 +384,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
nb_samples1 = av_resample(s->resample_context, buftmp3[i], bufin[i],
&consumed, nb_samples, lenout, is_last);
s->temp_len = nb_samples - consumed;
- s->temp[i] = av_realloc(s->temp[i], s->temp_len * sizeof(short));
+ s->temp[i] = av_realloc_array(s->temp[i], s->temp_len, sizeof(short));
memcpy(s->temp[i], bufin[i] + consumed, s->temp_len * sizeof(short));
}