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

Commit f2adcac3 authored by Dan Austin's avatar Dan Austin Committed by Gerrit Code Review
Browse files

Merge "Enable fsanitize-unsigned-integer for G711 soft decoder."

parents 51305b88 fc37612e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,6 +16,6 @@ LOCAL_MODULE_TAGS := optional

LOCAL_CFLAGS += -Werror
LOCAL_CLANG := true
LOCAL_SANITIZE := signed-integer-overflow
LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow

include $(BUILD_SHARED_LIBRARY)
+4 −2
Original line number Diff line number Diff line
@@ -262,7 +262,8 @@ void SoftG711::onQueueFilled(OMX_U32 /* portIndex */) {
// static
void SoftG711::DecodeALaw(
        int16_t *out, const uint8_t *in, size_t inSize) {
    while (inSize-- > 0) {
    while (inSize > 0) {
        inSize--;
        int32_t x = *in++;

        int32_t ix = x ^ 0x55;
@@ -288,7 +289,8 @@ void SoftG711::DecodeALaw(
// static
void SoftG711::DecodeMLaw(
        int16_t *out, const uint8_t *in, size_t inSize) {
    while (inSize-- > 0) {
    while (inSize > 0) {
        inSize--;
        int32_t x = *in++;

        int32_t mantissa = ~x;