[libbluray-devel] Check metadata partition file type

Petri Hintukainen git at videolan.org
Mon Jun 5 12:12:27 CEST 2017


libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Mon Jun  5 11:03:35 2017 +0300| [a49bdfa43c9becc26cfe5a170dacc2a9b718b197] | committer: Petri Hintukainen

Check metadata partition file type

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

 src/udfread.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/udfread.c b/src/udfread.c
index 04f7fcb..22b7031 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -509,7 +509,11 @@ static int _map_metadata_partition(udfread_block_input *input,
             continue;
         }
 
-        if (fe->file_type == UDF_FT_METADATA) {
+        if (fe->content_inline) {
+            udf_error("invalid metadata file (content inline)\n");
+        } else if (!fe->num_ad) {
+            udf_error("invalid metadata file (no allocation descriptors)\n");
+        } else if (fe->file_type == UDF_FT_METADATA) {
             part->p[1].lba = pd->start_block + fe->data.ad[0].lba;
             udf_log("metadata file at lba %u\n", part->p[1].lba);
         } else if (fe->file_type == UDF_FT_METADATA_MIRROR) {



More information about the libbluray-devel mailing list