matroskadec: avoid potential crash after r23169
authorAurelien Jacobs <aurel@gnuage.org>
Tue, 25 May 2010 22:55:12 +0000 (22:55 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Tue, 25 May 2010 22:55:12 +0000 (22:55 +0000)
Originally committed as revision 23330 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroskadec.c

index 3e33d08..33e3d88 100644 (file)
@@ -1793,7 +1793,7 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
     blocks_list = &cluster.blocks;
     blocks = blocks_list->elem;
     for (i=0; i<blocks_list->nb_elem; i++)
-        if (blocks[i].bin.size > 0) {
+        if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
             int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
             res=matroska_parse_block(matroska,
                                      blocks[i].bin.data, blocks[i].bin.size,