mxfdec: skip to end of structural sets
authorPhilip de Nier <philip.denier@rd.bbc.co.uk>
Mon, 12 Sep 2011 10:13:44 +0000 (11:13 +0100)
committerJanne Grunau <janne-libav@jannau.net>
Sun, 22 Jan 2012 13:40:52 +0000 (14:40 +0100)
This fixes reading of partition packs. The code stops reading after the
operational pattern and should skip the array of essence container
labels that follow.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavformat/mxfdec.c

index 33c931e..38e98a3 100644 (file)
@@ -1053,8 +1053,11 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 int res;
                 if (klv.key[5] == 0x53) {
                     res = mxf_read_local_tags(mxf, &klv, metadata->read, metadata->ctx_size, metadata->type);
-                } else
+                } else {
+                    uint64_t next = avio_tell(s->pb) + klv.length;
                     res = metadata->read(mxf, s->pb, 0, 0, klv.key);
+                    avio_seek(s->pb, next, SEEK_SET);
+                }
                 if (res < 0) {
                     av_log(s, AV_LOG_ERROR, "error reading header metadata\n");
                     return res;