summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2017-01-24 18:08:59 -0800
committerSean McCreary <mccreary@mcwest.org>2017-03-22 12:36:57 -0600
commite9598179f3e286a58e8222a3654701b330cd5268 (patch)
tree2155f38851c30624291e31aebe093427355e312f /media
parent85473b3d8e9a5ed76a431924b21b0b10e19bc7a0 (diff)
downloadframeworks_av-e9598179f3e286a58e8222a3654701b330cd5268.zip
frameworks_av-e9598179f3e286a58e8222a3654701b330cd5268.tar.gz
frameworks_av-e9598179f3e286a58e8222a3654701b330cd5268.tar.bz2
avc_utils: skip empty NALs from malformed bistreams
Avoid a CHECK and make it the decoder's repsonsibility to handle a malformed bistream gracefully. Bug: 34509901 Bug: 33137046 Test: StagefrightTest#testStagefright_bug_27855419_CVE_2016_2463 CVE-2017-0483 Change-Id: I2d94f8da63d65a86a9c711c45546e4c695e0f3b4 (cherry picked from commit 91fe76a157847825601b8f7a627efd1c9cbadcae) (cherry picked from commit 5cabe32a59f9be1e913b6a07a23d4cfa55e3fb2f)
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/avc_utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libstagefright/avc_utils.cpp b/media/libstagefright/avc_utils.cpp
index 98b5c0e..bf014ba 100644
--- a/media/libstagefright/avc_utils.cpp
+++ b/media/libstagefright/avc_utils.cpp
@@ -454,7 +454,10 @@ bool IsAVCReferenceFrame(const sp<ABuffer> &accessUnit) {
size_t nalSize;
bool bIsReferenceFrame = true;
while (getNextNALUnit(&data, &size, &nalStart, &nalSize, true) == OK) {
- CHECK_GT(nalSize, 0u);
+ if (nalSize == 0u) {
+ ALOGW("skipping empty nal unit from potentially malformed bitstream");
+ continue;
+ }
unsigned nalType = nalStart[0] & 0x1f;