From 4780a9540061624b749bb128a89a22021b8ea6a6 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 16 Feb 2019 19:55:14 +0000 Subject: aac: fixed ADTS parsing (#986) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8715 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/aac/aacfile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/Input/aac/aacfile.cpp') diff --git a/src/plugins/Input/aac/aacfile.cpp b/src/plugins/Input/aac/aacfile.cpp index a14002f75..8658ac7be 100644 --- a/src/plugins/Input/aac/aacfile.cpp +++ b/src/plugins/Input/aac/aacfile.cpp @@ -86,8 +86,10 @@ AACFile::AACFile(QIODevice *input, bool metaData, bool adts) //try to determnate header type; if ((uchar) buf[adts_offset] == 0xff && (((uchar)buf[adts_offset+1] & 0xf6) == 0xf0)) { - unsigned int frame_length = ((((unsigned int)buf[adts_offset+3] & 0x3)) << 11) - | (((unsigned int)buf[adts_offset+4]) << 3) | ((unsigned int)buf[adts_offset+5] >> 5); + unsigned int frame_length = uchar(buf[adts_offset + 3]) << 11; + frame_length |= uchar(buf[adts_offset + 4]) << 3; + frame_length |= uchar(buf[adts_offset + 5]) >> 5; + frame_length &= 0x1FFF; if(frame_length == 0 || (adts_offset + frame_length > buf_at - 6)) { -- cgit v1.2.3-13-gbd6f