aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-09 22:58:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-09 23:35:58 +0100
commitc63e76ba3553d7635b92ac3801f3087e85a76bfb (patch)
tree633c60872d607b6ae09a9f308903a9bad56e5e3b
parent98b377004d9c6fa1c1756c814efe9882b65f96b9 (diff)
downloadffmpeg-c63e76ba3553d7635b92ac3801f3087e85a76bfb.tar.gz
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>
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index ba53e342da..ec279ed3c9 100644
--- a/libavformat/matroskadec.c
+++ b/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;