matroskadec: empty blocks are in fact valid.
authorRonald S. Bultje <rsbultje@gmail.com>
Sat, 29 Oct 2011 23:17:51 +0000 (16:17 -0700)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 5 Nov 2011 13:59:27 +0000 (06:59 -0700)
libavformat/matroskadec.c

index 3f48a72..a40aa1c 100644 (file)
@@ -1679,11 +1679,12 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
     size -= n;
 
     track = matroska_find_track_by_num(matroska, num);
-    if (size <= 3 || !track || !track->stream) {
+    if (!track || !track->stream) {
         av_log(matroska->ctx, AV_LOG_INFO,
                "Invalid stream %"PRIu64" or size %u\n", num, size);
         return AVERROR_INVALIDDATA;
-    }
+    } else if (size <= 3)
+        return 0;
     st = track->stream;
     if (st->discard >= AVDISCARD_ALL)
         return res;