[libbluray-devel] Change _decode_file_ads() parameters

Petri Hintukainen git at videolan.org
Tue Jan 24 22:52:28 CET 2017


libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Tue Jan 24 23:00:47 2017 +0200| [830299499024f763f43ec4513bf25fa16f5c8aeb] | committer: Petri Hintukainen

Change _decode_file_ads() parameters

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

 src/ecma167.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/ecma167.c b/src/ecma167.c
index ab7a5b9..e25fa3d 100644
--- a/src/ecma167.c
+++ b/src/ecma167.c
@@ -232,23 +232,24 @@ static void _decode_extended_ad(const uint8_t *buf, struct long_ad *ad)
 
 /* File Entry */
 
-static void _decode_file_ads(const uint8_t *p, int flags, uint16_t partition, struct file_entry *fe)
+static void _decode_file_ads(const uint8_t *p, int flags, uint16_t partition,
+                             struct long_ad *ad, unsigned num_ad)
 {
     uint32_t i;
 
     flags &= 7;
-    for (i = 0; i < fe->num_ad; i++) {
+    for (i = 0; i < num_ad; i++) {
         switch (flags) {
         case 0:
-            _decode_short_ad(p, partition, &fe->data.ad[i]);
+            _decode_short_ad(p, partition, &ad[i]);
             p += 8;
             break;
         case 1:
-            decode_long_ad(p, &fe->data.ad[i]);
+            decode_long_ad(p, &ad[i]);
             p += 16;
             break;
         case 2:
-            _decode_extended_ad(p, &fe->data.ad[i]);
+            _decode_extended_ad(p, &ad[i]);
             p += 20;
             break;
         }
@@ -308,7 +309,7 @@ static struct file_entry *_decode_file_entry(const uint8_t *p, size_t size,
         fe->content_inline = 1;
         memcpy(fe->data.content, p + p_ad, l_ad);
     } else {
-        _decode_file_ads(p + p_ad, tag.flags, partition, fe);
+        _decode_file_ads(p + p_ad, tag.flags, partition, &fe->data.ad[0], num_ad);
     }
 
     return fe;



More information about the libbluray-devel mailing list