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

Commit b6e8b6b8 authored by Robert Shih's avatar Robert Shih Committed by android-build-merger
Browse files

avc_utils: skip empty NALs from malformed bistreams am: 91fe76a1 am: f79f26d2

am: 2b5d2c4a

Change-Id: Idf43a017719d40c95e5a353985915ff80c02c0e2
parents 199484a5 2b5d2c4a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -429,7 +429,10 @@ bool IsIDR(const sp<ABuffer> &buffer) {
    const uint8_t *nalStart;
    const uint8_t *nalStart;
    size_t nalSize;
    size_t nalSize;
    while (getNextNALUnit(&data, &size, &nalStart, &nalSize, true) == OK) {
    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;
        unsigned nalType = nalStart[0] & 0x1f;