From 5e1bacf2d49622f7ba4245f140b7be35972c0529 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 4 Dec 2012 03:30:40 +0100 Subject: [PATCH] matroskadec: reset size when freeing data. Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavformat/matroskadec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index d37346b47e..feb7b8404a 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -770,6 +770,7 @@ static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin) bin->pos = avio_tell(pb); if (avio_read(pb, bin->data, length) != length) { av_freep(&bin->data); + bin->size = 0; return AVERROR(EIO); }