git » fp-git.git » commit c534828

pcs detection now uses the information that the size must be checksum + 1 byte + 3 bytes per note

author ecalot
2005-06-08 11:14:48 UTC
committer ecalot
2005-06-08 11:14:48 UTC
parent 7e0a3b7767265644dd2f76addddb417b51bbe7c3

pcs detection now uses the information that the size must be checksum + 1 byte + 3 bytes per note

PR/src/lib/layers/autodetect.c +1 -1
PR/src/lib/layers/idlist.c +1 -1
PR/src/lib/xml/tree.c +1 -1
PR/src/lib/xml/unknown.c +1 -1

diff --git a/PR/src/lib/layers/autodetect.c b/PR/src/lib/layers/autodetect.c
index fde6ffe..38e8694 100644
--- a/PR/src/lib/layers/autodetect.c
+++ b/PR/src/lib/layers/autodetect.c
@@ -82,7 +82,7 @@ int verifyMidiHeader(const unsigned char *array, int size) {
 
 int verifyWaveHeader(const unsigned char *array, int size) {
 	return
-		(size>1)&&(array[1]==0x01)
+		(size>1)&&(array[1]==0x01)&&((size%3)==2)
 	;
 }
 
diff --git a/PR/src/lib/layers/idlist.c b/PR/src/lib/layers/idlist.c
index fde6ffe..38e8694 100644
--- a/PR/src/lib/layers/idlist.c
+++ b/PR/src/lib/layers/idlist.c
@@ -82,7 +82,7 @@ int verifyMidiHeader(const unsigned char *array, int size) {
 
 int verifyWaveHeader(const unsigned char *array, int size) {
 	return
-		(size>1)&&(array[1]==0x01)
+		(size>1)&&(array[1]==0x01)&&((size%3)==2)
 	;
 }
 
diff --git a/PR/src/lib/xml/tree.c b/PR/src/lib/xml/tree.c
index fde6ffe..38e8694 100644
--- a/PR/src/lib/xml/tree.c
+++ b/PR/src/lib/xml/tree.c
@@ -82,7 +82,7 @@ int verifyMidiHeader(const unsigned char *array, int size) {
 
 int verifyWaveHeader(const unsigned char *array, int size) {
 	return
-		(size>1)&&(array[1]==0x01)
+		(size>1)&&(array[1]==0x01)&&((size%3)==2)
 	;
 }
 
diff --git a/PR/src/lib/xml/unknown.c b/PR/src/lib/xml/unknown.c
index fde6ffe..38e8694 100644
--- a/PR/src/lib/xml/unknown.c
+++ b/PR/src/lib/xml/unknown.c
@@ -82,7 +82,7 @@ int verifyMidiHeader(const unsigned char *array, int size) {
 
 int verifyWaveHeader(const unsigned char *array, int size) {
 	return
-		(size>1)&&(array[1]==0x01)
+		(size>1)&&(array[1]==0x01)&&((size%3)==2)
 	;
 }