ebml_read_binary: use fast_padded_malloc()

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/6/merge
Michael Niedermayer 12 years ago
parent 98b377004d
commit c63e76ba35
  1. 4
      libavformat/matroskadec.c

@ -762,8 +762,8 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
*/
static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
{
av_free(bin->data);
if (!(bin->data = av_malloc(length)))
av_fast_padded_malloc(&bin->data, &bin->size, length);
if (!bin->data)
return AVERROR(ENOMEM);
bin->size = length;

Loading…
Cancel
Save