ref: 33ccbc88f1dd7052ac6ed70982bcae51e9b722f4
parent: 8ecf51975485a076db1fe5a9d708e64fc08c700e
author: cbagwell <cbagwell>
date: Tue Sep 20 21:36:39 EDT 2005
word-align SSND and APPL chunks.
--- a/Changelog
+++ b/Changelog
@@ -36,6 +36,8 @@
o Added ALSA support to play/rec scripts.
o Added st_open* and st_close() routines to help simply
developer interface to libst.
+ o Force word-alignment on AIFF SSND and APPL chunks on input.
+ Matthew Hodgson.
sox-12.17.8
-----------
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -204,6 +204,10 @@
st_readdw(ft, &blocksize);
chunksize -= 8;
ssndsize = chunksize;
+ /* word-align chunksize in case it wasn't
+ * done by writing application already.
+ */
+ chunksize += (chunksize % 2);
/* if can't seek, just do sound now */
if (!ft->seekable)
break;
@@ -273,6 +277,10 @@
}
else if (strncmp(buf, "APPL", 4) == 0) {
st_readdw(ft, &chunksize);
+ /* word-align chunksize in case it wasn't
+ * done by writing application already.
+ */
+ chunksize += (chunksize % 2);
while(chunksize-- > 0)
st_readb(ft, (unsigned char *)&trash8);
}