Commit c63e76ba authored by Michael Niedermayer's avatar Michael Niedermayer

ebml_read_binary: use fast_padded_malloc()

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 98b37700
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment