diff options
-rw-r--r-- | media/libstagefright/DRMExtractor.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/DRMExtractor.cpp b/media/libstagefright/DRMExtractor.cpp index 63cb430..9cb6e86 100644 --- a/media/libstagefright/DRMExtractor.cpp +++ b/media/libstagefright/DRMExtractor.cpp @@ -186,7 +186,8 @@ status_t DRMSource::read(MediaBuffer **buffer, const ReadOptions *options) { srcOffset += mNALLengthSize; - if (srcOffset + nalLength > len) { + size_t end = srcOffset + nalLength; + if (end > len || end < srcOffset) { if (decryptedDrmBuffer.data) { delete [] decryptedDrmBuffer.data; decryptedDrmBuffer.data = NULL; |