[FFmpeg-cvslog] matroskadec: reset size when freeing data.

Michael Niedermayer git at videolan.org
Tue Dec 4 03:54:39 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec  4 03:30:40 2012 +0100| [5e1bacf2d49622f7ba4245f140b7be35972c0529] | committer: Michael Niedermayer

matroskadec: reset size when freeing data.

Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e1bacf2d49622f7ba4245f140b7be35972c0529
---

 libavformat/matroskadec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d37346b..feb7b84 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);
     }
 



More information about the ffmpeg-cvslog mailing list