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

Commit 34fe252c authored by James Dong's avatar James Dong
Browse files

Remove the assertion and report content malform error to application

Change-Id: I8e30c586048d38334fd4366959a124a99d8efe28
related-to-bug: 4267147
parent 88a90ab5
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2028,14 +2028,18 @@ status_t MPEG4Source::read(
            size_t dstOffset = 0;

            while (srcOffset < size) {
                CHECK(srcOffset + mNALLengthSize <= size);
                size_t nalLength = parseNALSize(&mSrcBuffer[srcOffset]);
                bool isMalFormed = (srcOffset + mNALLengthSize > size);
                size_t nalLength = 0;
                if (!isMalFormed) {
                    nalLength = parseNALSize(&mSrcBuffer[srcOffset]);
                    srcOffset += mNALLengthSize;
                    isMalFormed = srcOffset + nalLength > size;
                }

                if (srcOffset + nalLength > size) {
                if (isMalFormed) {
                    LOGE("Video is malformed");
                    mBuffer->release();
                    mBuffer = NULL;

                    return ERROR_MALFORMED;
                }