[FFmpeg-cvslog] matroskadec: empty blocks are in fact valid.

Ronald S. Bultje git at videolan.org
Sun Nov 6 02:39:15 CET 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sat Oct 29 16:17:51 2011 -0700| [d31fb1a9e77f37ee1bbc0faabc655390eb91b579] | committer: Ronald S. Bultje

matroskadec: empty blocks are in fact valid.

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

 libavformat/matroskadec.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 3f48a72..a40aa1c 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list