From: Pali Rohár Date: Wed, 15 Nov 2017 17:12:50 +0000 (+0100) Subject: libblkid: udf: Stop scanning Volume Descriptors after we found Terminating Descriptor X-Git-Tag: v2.32-rc1~198^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4572e4070d2255801cad0648a8e1e9fc37af8aaa;p=thirdparty%2Futil-linux.git libblkid: udf: Stop scanning Volume Descriptors after we found Terminating Descriptor 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 --- diff --git a/libblkid/src/superblocks/udf.c b/libblkid/src/superblocks/udf.c index bc7273ca53..7f98a15f83 100644 --- a/libblkid/src/superblocks/udf.c +++ b/libblkid/src/superblocks/udf.c @@ -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);