swresample/dither: use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Apr 2014 22:29:06 +0000 (00:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 21 Apr 2014 22:21:28 +0000 (00:21 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a5290cb1ac047851563da7aca06569e3ada55f79)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/dither.c

index 79113f4..28cfbdd 100644 (file)
@@ -24,7 +24,7 @@
 void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt) {
     double scale = 0;
 #define TMP_EXTRA 2
-    double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
+    double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double));
     int i;
 
     out_fmt = av_get_packed_sample_fmt(out_fmt);