diff libmpcodecs/ad_hwac3.c @ 24436:c1b98b43b897

Fix off-by-one error if fsize is odd (does handling that case even make sense?) and remove a TODO comment that no longer applies.
author reimar
date Fri, 14 Sep 2007 12:52:13 +0000
parents 79163e100830
children 4f9b7524f65d
line wrap: on
line diff
--- a/libmpcodecs/ad_hwac3.c	Fri Sep 14 12:47:15 2007 +0000
+++ b/libmpcodecs/ad_hwac3.c	Fri Sep 14 12:52:13 2007 +0000
@@ -360,10 +360,9 @@
 #ifdef WORDS_BIGENDIAN
   memcpy(&buf[8], indata_ptr, fsize);
 #else
-  //TODO if fzise is odd, swab doesn't copy the last byte
   swab(indata_ptr, &buf[8], fsize);
   if (fsize & 1)
-    buf[8+fsize] = indata_ptr[fsize];
+    buf[8+fsize-1] = indata_ptr[fsize-1];
 #endif
   memset(&buf[fsize + 8], 0, nr_samples * 2 * 2 - (fsize + 8));