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); }