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

Commit 315ac4a8 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

SoftAAC2: fix crash on all-zero adts buffer

Bug: 29153599
Change-Id: I1cb81c054098b86cf24f024f8479909ca7bc85a6
parent 823bd745
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -625,7 +625,9 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) {
                        signalError = true;
                    } else {
                        adtsHeaderSize = (protectionAbsent ? 7 : 9);

                        if (aac_frame_length < adtsHeaderSize) {
                            signalError = true;
                        } else {
                            inBuffer[0] = (UCHAR *)adtsHeader + adtsHeaderSize;
                            inBufferLength[0] = aac_frame_length - adtsHeaderSize;

@@ -633,6 +635,7 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) {
                            inHeader->nFilledLen -= adtsHeaderSize;
                        }
                    }
                }

                if (signalError) {
                    mSignalledError = true;