1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Index: apps/metadata/adx.c
===================================================================
--- apps/metadata/adx.c  (Revision 31092)
+++ apps/metadata/adx.c  (Arbeitskopie)
@@ -73,7 +73,7 @@
     id3->filesize = filesize(fd);
     
     /* get loop info */
-    if (!memcmp(buf+0x10,"\x01\xF4\x03\x00",4)) {
+    if (!memcmp(buf+0x10,"\x01\xF4\x03",3)) {
         /* Soul Calibur 2 style (type 03) */
         DEBUGF("get_adx_metadata: type 03 found\n");
         /* check if header is too small for loop data */
@@ -83,7 +83,7 @@
             end_adr = get_long_be(&buf[0x28]);
             start_adr = get_long_be(&buf[0x1c])/32*channels*18+chanstart;
         }
-    } else if (!memcmp(buf+0x10,"\x01\xF4\x04\x00",4)) {
+    } else if (!memcmp(buf+0x10,"\x01\xF4\x04",3)) {
         /* Standard (type 04) */
         DEBUGF("get_adx_metadata: type 04 found\n");
         /* check if header is too small for loop data */
@@ -98,6 +98,12 @@
         return false;
     }
     
+    /* is file using encryption */
+    if (buf[0x13]==0x08) {
+        DEBUGF("get_adx_metadata: error, encrypted ADX not supported\n");
+        return false;
+    }
+    
     if (looping) {
         /* 2 loops, 10 second fade */
         id3->length = (start_adr-chanstart + 2*(end_adr-start_adr))
Index: apps/codecs/adx.c
===================================================================
--- apps/codecs/adx.c  (Revision 31092)
+++ apps/codecs/adx.c  (Arbeitskopie)
@@ -149,7 +149,7 @@
     /* Get loop data */
     
     looping = 0; start_adr = 0; end_adr = 0;
-    if (!memcmp(buf+0x10,"\x01\xF4\x03\x00",4)) {
+    if (!memcmp(buf+0x10,"\x01\xF4\x03",3)) {
         /* Soul Calibur 2 style (type 03) */
         DEBUGF("ADX: type 03 found\n");
         /* check if header is too small for loop data */
@@ -171,7 +171,7 @@
               (buf[0x1f])
               )/32*channels*18+chanstart;
         }
-    } else if (!memcmp(buf+0x10,"\x01\xF4\x04\x00",4)) {
+    } else if (!memcmp(buf+0x10,"\x01\xF4\x04",3)) {
         /* Standard (type 04) */
         DEBUGF("ADX: type 04 found\n");
         /* check if header is too small for loop data */
@@ -196,6 +196,12 @@
         DEBUGF("ADX: error, couldn't determine ADX type\n");
         return CODEC_ERROR;
     }
+    
+    /* is file using encryption */
+    if (buf[0x13]==0x08) {
+        DEBUGF("ADX: error, encrypted ADX not supported\n");
+        return false;
+    }
 
     if (looping) {
         DEBUGF("ADX: looped, start: %lx end: %lx\n",start_adr,end_adr);