OSDN Git Service
(root)
/
android-x86
/
frameworks-av.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ce2938
)
Check buffer size before using it
author
Marco Nelissen
<marcone@google.com>
Wed, 1 Jul 2015 20:05:50 +0000
(13:05 -0700)
committer
Abhishek Arya
<aarya@google.com>
Sat, 15 Aug 2015 03:59:05 +0000
(
03:59
+0000)
Bug:
21814993
Change-Id: Idaac61b4b9f4058b94e84093644593ba315d72ff
(cherry picked from commit
c1a104aaad2d84a57bf5d87dd030d2bef56bf541
)
media/libstagefright/MPEG4Extractor.cpp
patch
|
blob
|
history
diff --git
a/media/libstagefright/MPEG4Extractor.cpp
b/media/libstagefright/MPEG4Extractor.cpp
index
56bd875
..
46010ca
100644
(file)
--- a/
media/libstagefright/MPEG4Extractor.cpp
+++ b/
media/libstagefright/MPEG4Extractor.cpp
@@
-3193,6
+3193,10
@@
status_t MPEG4Source::read(
CHECK(mBuffer == NULL);
return err;
}
+ if (size > mBuffer->size()) {
+ ALOGE("buffer too small: %zu > %zu", size, mBuffer->size());
+ return ERROR_BUFFER_TOO_SMALL;
+ }
}
if (!mIsAVC || mWantsNALFragments) {
@@
-3439,6
+3443,10
@@
status_t MPEG4Source::fragmentedRead(
ALOGV("acquire_buffer returned %d", err);
return err;
}
+ if (size > mBuffer->size()) {
+ ALOGE("buffer too small: %zu > %zu", size, mBuffer->size());
+ return ERROR_BUFFER_TOO_SMALL;
+ }
}
const Sample *smpl = &mCurrentSamples[mCurrentSampleIndex];