avcodec/snowenc-test: use av_mallocz_array()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Jan 2015 14:04:15 +0000 (15:04 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Jan 2015 14:04:15 +0000 (15:04 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snowenc.c

index 73b544a734569bc9a5cc645a11f8521b19a3c67e..cd8fef3e9e6a9280bba4a3e4c5f44f4eaaba6b67 100644 (file)
@@ -1919,8 +1919,8 @@ int main(void){
     s.spatial_decomposition_count=6;
     s.spatial_decomposition_type=1;
 
-    s.temp_dwt_buffer  = av_mallocz(width * sizeof(DWTELEM));
-    s.temp_idwt_buffer = av_mallocz(width * sizeof(IDWTELEM));
+    s.temp_dwt_buffer  = av_mallocz_array(width, sizeof(DWTELEM));
+    s.temp_idwt_buffer = av_mallocz_array(width, sizeof(IDWTELEM));
 
     if (!s.temp_dwt_buffer || !s.temp_idwt_buffer) {
         fprintf(stderr, "Failed to allocate memory\n");