diff options
-rw-r--r-- | media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp index d239e7b..4302aee 100644 --- a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp +++ b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp @@ -379,7 +379,10 @@ sp<ABuffer> AMPEG4AudioAssembler::removeLATMFraming(const sp<ABuffer> &buffer) { unsigned muxSlotLengthBytes = 0; unsigned tmp; do { - CHECK_LT(offset, buffer->size()); + if (offset >= buffer->size()) { + ALOGW("Malformed buffer received"); + return out; + } tmp = ptr[offset++]; muxSlotLengthBytes += tmp; } while (tmp == 0xff); |