avcodec/flacenc: Use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 16:28:40 +0000 (18:28 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 30 Apr 2014 16:28:40 +0000 (18:28 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/flacenc.c

index 1fc8c4c..b6ae4af 100644 (file)
@@ -649,7 +649,7 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
 
     tmp_rc.coding_mode = rc->coding_mode;
 
-    udata = av_malloc(n * sizeof(uint32_t));
+    udata = av_malloc_array(n,  sizeof(uint32_t));
     for (i = 0; i < n; i++)
         udata[i] = (2*data[i]) ^ (data[i]>>31);