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

Commit 3e8686b7 authored by Arne Coucheron's avatar Arne Coucheron
Browse files

libstagefright: Add error handling in AMRNB deooder

Return error when AMRNB software decoder fails

Change-Id: I125b2abbdd2eb182b69393752a9377eda89361d9
parent cc88ea00
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -161,6 +161,11 @@ status_t AMRNBDecoder::read(
          static_cast<int16_t *>(buffer->data()),
          MIME_IETF);

    if (numBytesRead == -1 ) {
        buffer->release();
        buffer = NULL;
        return ERROR_MALFORMED;
    }
    ++numBytesRead;  // Include the frame type header byte.

    buffer->set_range(0, kNumSamplesPerFrame * sizeof(int16_t));