6d51a8b
From 22ba393bd54b72da01ed2cd9f6705c1a7ca59d3a Mon Sep 17 00:00:00 2001
6d51a8b
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
6d51a8b
Date: Sun, 11 Jan 2015 18:16:28 -0500
6d51a8b
Subject: [PATCH 1/2] fix lba calculation for BE
6d51a8b
6d51a8b
---
6d51a8b
 lib/udf/udf_fs.c | 6 +++---
6d51a8b
 1 file changed, 3 insertions(+), 3 deletions(-)
6d51a8b
6d51a8b
diff --git a/lib/udf/udf_fs.c b/lib/udf/udf_fs.c
6d51a8b
index a3b10d0..beaeb79 100644
6d51a8b
--- a/lib/udf/udf_fs.c
6d51a8b
+++ b/lib/udf/udf_fs.c
6d51a8b
@@ -167,7 +167,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe,
6d51a8b
     {
6d51a8b
       /* The allocation descriptor field is filled with short_ad's. */
6d51a8b
       udf_short_ad_t *p_ad = (udf_short_ad_t *)
6d51a8b
-	(p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr);
6d51a8b
+	(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr));
6d51a8b
 
6d51a8b
       *start = uint32_from_le(p_ad->pos);
6d51a8b
       *end = *start +
6d51a8b
@@ -179,7 +179,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe,
6d51a8b
     {
6d51a8b
       /* The allocation descriptor field is filled with long_ad's */
6d51a8b
       udf_long_ad_t *p_ad = (udf_long_ad_t *)
6d51a8b
-	(p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr);
6d51a8b
+	(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr));
6d51a8b
 
6d51a8b
       *start = uint32_from_le(p_ad->loc.lba); /* ignore partition number */
6d51a8b
       *end = *start +
6d51a8b
@@ -190,7 +190,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe,
6d51a8b
   case ICBTAG_FLAG_AD_EXTENDED:
6d51a8b
     {
6d51a8b
       udf_ext_ad_t *p_ad = (udf_ext_ad_t *)
6d51a8b
-	(p_udf_fe->u.ext_attr + p_udf_fe->i_extended_attr);
6d51a8b
+	(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr));
6d51a8b
 
6d51a8b
       *start = uint32_from_le(p_ad->ext_loc.lba); /* ignore partition number */
6d51a8b
       *end = *start +
6d51a8b
-- 
6d51a8b
2.1.0
6d51a8b
6d51a8b
6d51a8b
From b4e3a76af159b5f0d5f006f6acd6df10d4ffaefa Mon Sep 17 00:00:00 2001
6d51a8b
From: Michal Toman <mtoman@redhat.com>
6d51a8b
Date: Tue, 13 Jan 2015 05:40:14 -0500
6d51a8b
Subject: [PATCH 2/2] udf_readdir: fix lba on BE
6d51a8b
6d51a8b
Signed-off-by: Michal Toman <mtoman@redhat.com>
6d51a8b
---
6d51a8b
 lib/udf/udf_fs.c | 2 +-
6d51a8b
 1 file changed, 1 insertion(+), 1 deletion(-)
6d51a8b
6d51a8b
diff --git a/lib/udf/udf_fs.c b/lib/udf/udf_fs.c
6d51a8b
index beaeb79..a0a3903 100644
6d51a8b
--- a/lib/udf/udf_fs.c
6d51a8b
+++ b/lib/udf/udf_fs.c
6d51a8b
@@ -739,7 +739,7 @@ udf_readdir(udf_dirent_t *p_udf_dirent)
6d51a8b
 	const unsigned int i_len = p_udf_dirent->fid->i_file_id;
6d51a8b
 
6d51a8b
 	if (DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &p_udf_dirent->fe, p_udf->i_part_start
6d51a8b
-			 + p_udf_dirent->fid->icb.loc.lba, 1)) {
6d51a8b
+			 + uint32_from_le(p_udf_dirent->fid->icb.loc.lba), 1)) {
6d51a8b
 		udf_dirent_free(p_udf_dirent);
6d51a8b
 		return NULL;
6d51a8b
 	}
6d51a8b
-- 
6d51a8b
2.1.0
6d51a8b