vcodec/bitstream: use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Apr 2014 14:18:29 +0000 (16:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Apr 2014 14:18:29 +0000 (16:18 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/bitstream.c

index e907322..5cb8631 100644 (file)
@@ -293,7 +293,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
         vlc->table_allocated = 0;
         vlc->table_size      = 0;
 
-        buf = av_malloc((nb_codes + 1) * sizeof(VLCcode));
+        buf = av_malloc_array((nb_codes + 1), sizeof(VLCcode));
         if (!buf)
             return AVERROR(ENOMEM);
     }