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

Commit 3faebc5e authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] [DO NOT MERGE] AMR WB encoder: prevent OOB write in ACELP_4t64_fx...

[automerger] [DO NOT MERGE] AMR WB encoder: prevent OOB write in ACELP_4t64_fx am: 04e48ed8 am: 8b8f583f am: 30d710f5

Change-Id: Ic5935865167a8ea30c207140d61b6b42475a07b0
parents 4a6825b4 30d710f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,8 @@ LOCAL_ARM_MODE := arm


LOCAL_STATIC_LIBRARIES :=
LOCAL_STATIC_LIBRARIES :=


LOCAL_SHARED_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := \
        liblog


LOCAL_C_INCLUDES := \
LOCAL_C_INCLUDES := \
	frameworks/av/include \
	frameworks/av/include \
+2 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,8 @@ LOCAL_CFLAGS :=


LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
    libstagefright \
    libstagefright \
    libdl
    libdl \
    liblog


LOCAL_STATIC_LIBRARIES := \
LOCAL_STATIC_LIBRARIES := \
    libstagefright_amrwbenc
    libstagefright_amrwbenc
+11 −2
Original line number Original line Diff line number Diff line
@@ -47,6 +47,10 @@


#include "q_pulse.h"
#include "q_pulse.h"


#undef LOG_TAG
#define LOG_TAG "amrwbenc"
#include <log/log.h>

static Word16 tipos[36] = {
static Word16 tipos[36] = {
    0, 1, 2, 3,                            /* starting point &ipos[0], 1st iter */
    0, 1, 2, 3,                            /* starting point &ipos[0], 1st iter */
    1, 2, 3, 0,                            /* starting point &ipos[4], 2nd iter */
    1, 2, 3, 0,                            /* starting point &ipos[4], 2nd iter */
@@ -745,11 +749,16 @@ void ACELP_4t64_fx(


        i = (Word16)((vo_L_mult(track, NPMAXPT) >> 1));
        i = (Word16)((vo_L_mult(track, NPMAXPT) >> 1));


        while (ind[i] >= 0)
        while (i < NPMAXPT * NB_TRACK && ind[i] >= 0)
        {
        {
            i += 1;
            i += 1;
        }
        }
        if (i < NPMAXPT * NB_TRACK) {
            ind[i] = index;
            ind[i] = index;
        } else {
            ALOGE("b/132647222, OOB access in ind array track=%d i=%d", track, i);
            android_errorWriteLog(0x534e4554, "132647222");
        }
    }
    }


    k = 0;
    k = 0;