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
This commit is contained in:
reimar 2007-09-14 12:52:13 +00:00
parent 73acce23fd
commit 502368c206
1 changed files with 1 additions and 2 deletions

View File

@ -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));