]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: udf: Stop scanning Volume Descriptors after we found Terminating Descriptor
authorPali Rohár <pali.rohar@gmail.com>
Wed, 15 Nov 2017 17:12:50 +0000 (18:12 +0100)
committerPali Rohár <pali.rohar@gmail.com>
Wed, 15 Nov 2017 17:12:50 +0000 (18:12 +0100)
Terminating Descriptor is the last descriptor in Volume Descriptor
Sequence. After it there can be unrecorded or empty sectors which we do not
have to scan.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
libblkid/src/superblocks/udf.c

index bc7273ca536dca8d0aa183f9baf48f72320c2e3d..7f98a15f831620c664a13418149d3a8d67532788 100644 (file)
@@ -94,6 +94,7 @@ struct volume_descriptor {
 #define TAG_ID_PVD  1
 #define TAG_ID_AVDP 2
 #define TAG_ID_LVD  6
+#define TAG_ID_TD   8
 #define TAG_ID_LVID 9
 
 struct volume_structure_descriptor {
@@ -290,6 +291,8 @@ real_blksz:
                        break;
                if (le32_to_cpu(vd->tag.location) != loc + b)
                        break;
+               if (type == TAG_ID_TD)
+                       break;
                if (type == TAG_ID_PVD) {
                        if (!have_volid) {
                                int enc = udf_cid_to_enc(vd->type.primary.ident.cid);