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
Change-Id: I2d94f8da63d65a86a9c711c45546e4c695e0f3b4
(cherry picked from commit 91fe76a157847825601b8f7a627efd1c9cbadcae)
diff --git a/media/libstagefright/avc_utils.cpp b/media/libstagefright/avc_utils.cpp
index 0396dc6..763381e 100644
--- a/media/libstagefright/avc_utils.cpp
+++ b/media/libstagefright/avc_utils.cpp
@@ -456,7 +456,10 @@
     const uint8_t *nalStart;
     size_t nalSize;
     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;