# HG changeset patch # User reimar # Date 1189774333 0 # Node ID c1b98b43b897c58aad4f4da5de47b5aa367870a4 # Parent 79163e100830c5b74fdac9b1ee8f49b8c5e2acf2 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. diff -r 79163e100830 -r c1b98b43b897 libmpcodecs/ad_hwac3.c --- 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));