From 4572e4070d2255801cad0648a8e1e9fc37af8aaa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Wed, 15 Nov 2017 18:12:50 +0100 Subject: [PATCH] libblkid: udf: Stop scanning Volume Descriptors after we found Terminating Descriptor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- libblkid/src/superblocks/udf.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.47.3