Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 495d7b19 authored by Dean Wheatley's avatar Dean Wheatley Committed by Mikhail Naganov
Browse files

Fix EAC3 bsid parsing

Comply with ETSI TS 102 366 V1.4.1 E.1.3.1.6

Bug: 125456292
Test: see repro steps
Change-Id: Ieb8414d83e63a3c968409c31e8130ada7238c5d4
parent 05677f7f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3021,8 +3021,10 @@ status_t MPEG4Extractor::parseEAC3SpecificBox(off64_t offset) {
        }

        unsigned bsid = br.getBits(5);
        if (bsid < 8) {
            ALOGW("Incorrect bsid in EAC3 header. Possibly AC-3?");
        if (bsid == 9 || bsid == 10) {
            ALOGW("EAC3 stream (bsid=%d) may be silenced by the decoder", bsid);
        } else if (bsid > 16) {
            ALOGE("EAC3 stream (bsid=%d) is not compatible with ETSI TS 102 366 v1.4.1", bsid);
            delete[] chunk;
            return ERROR_MALFORMED;
        }