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

Commit 91fe76a1 authored by Robert Shih's avatar Robert Shih
Browse files

avc_utils: skip empty NALs from malformed bistreams

Avoid a CHECK and make it the decoder's repsonsibility to handle a
malformed bistream gracefully.

Bug: 34509901
Bug: 33137046
Test: StagefrightTest#testStagefright_bug_27855419_CVE_2016_2463
Change-Id: I2d94f8da63d65a86a9c711c45546e4c695e0f3b4
parent 8474c51a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -417,7 +417,10 @@ bool IsIDR(const sp<ABuffer> &buffer) {
    const uint8_t *nalStart;
    size_t nalSize;
    while (getNextNALUnit(&data, &size, &nalStart, &nalSize, true) == OK) {
        CHECK_GT(nalSize, 0u);
        if (nalSize == 0u) {
            ALOGW("skipping empty nal unit from potentially malformed bitstream");
            continue;
        }

        unsigned nalType = nalStart[0] & 0x1f;