зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1128939: Part2. Make sure we limit read to buffer size and handle error nicely. r=k17e
This commit is contained in:
Родитель
3099b941be
Коммит
4132c3064d
|
@ -3497,7 +3497,14 @@ status_t MPEG4Source::read(
|
|||
// Each NAL unit is split up into its constituent fragments and
|
||||
// each one of them returned in its own buffer.
|
||||
|
||||
CHECK(mBuffer->range_length() >= mNALLengthSize);
|
||||
if (mBuffer->range_length() < mNALLengthSize) {
|
||||
ALOGE("incomplete NAL unit.");
|
||||
|
||||
mBuffer->release();
|
||||
mBuffer = NULL;
|
||||
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
|
||||
const uint8_t *src =
|
||||
(const uint8_t *)mBuffer->data() + mBuffer->range_offset();
|
||||
|
@ -3859,7 +3866,14 @@ status_t MPEG4Source::fragmentedRead(
|
|||
// Each NAL unit is split up into its constituent fragments and
|
||||
// each one of them returned in its own buffer.
|
||||
|
||||
CHECK(mBuffer->range_length() >= mNALLengthSize);
|
||||
if (mBuffer->range_length() < mNALLengthSize) {
|
||||
ALOGE("incomplete NAL unit.");
|
||||
|
||||
mBuffer->release();
|
||||
mBuffer = NULL;
|
||||
|
||||
return ERROR_MALFORMED;
|
||||
}
|
||||
|
||||
const uint8_t *src =
|
||||
(const uint8_t *)mBuffer->data() + mBuffer->range_offset();
|
||||
|
|
Загрузка…
Ссылка в новой задаче