From 502368c206107a101d6c982119e952fa3814ad02 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 14 Sep 2007 12:52:13 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24456 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_hwac3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libmpcodecs/ad_hwac3.c b/libmpcodecs/ad_hwac3.c index 559dffd29f..6cfc4e1485 100644 --- a/libmpcodecs/ad_hwac3.c +++ b/libmpcodecs/ad_hwac3.c @@ -360,10 +360,9 @@ static int decode_audio_dts(unsigned char *indata_ptr, int len, unsigned char *b #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));