avutil/pca: Use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 4 May 2014 17:00:16 +0000 (19:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 4 May 2014 17:00:16 +0000 (19:00 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/pca.c

index 311b6bc..26d5bbb 100644 (file)
@@ -42,7 +42,7 @@ PCA *ff_pca_init(int n){
 
     pca= av_mallocz(sizeof(*pca));
     pca->n= n;
-    pca->z = av_malloc(sizeof(*pca->z) * n);
+    pca->z = av_malloc_array(n, sizeof(*pca->z));
     pca->count=0;
     pca->covariance= av_calloc(n*n, sizeof(double));
     pca->mean= av_calloc(n, sizeof(double));