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

Commit b5ce7ae2 authored by Wei Jia's avatar Wei Jia
Browse files

SoftVorbis: fail gracefully when hitting invalid parameter.

Bug: 27843650
Change-Id: I0150414854da6a5e61bc13f5cb5ff470b8e35894
parent 9ce67b52
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -338,7 +338,13 @@ void SoftVorbis::onQueueFilled(OMX_U32 portIndex) {
            }

            if (inHeader->nFilledLen || !mSawInputEos) {
                CHECK_GE(inHeader->nFilledLen, sizeof(numPageSamples));
                if (inHeader->nFilledLen < sizeof(numPageSamples)) {
                    notify(OMX_EventError, OMX_ErrorBadParameter, 0, NULL);
                    mSignalledError = true;
                    ALOGE("onQueueFilled, input header has nFilledLen %u, expected %zu",
                            inHeader->nFilledLen, sizeof(numPageSamples));
                    return;
                }
                memcpy(&numPageSamples,
                       inHeader->pBuffer
                        + inHeader->nOffset + inHeader->nFilledLen - 4,