OSDN Git Service

MPEG4Source: fix fragmented read.
authorWei Jia <wjia@google.com>
Fri, 24 Mar 2017 21:04:05 +0000 (14:04 -0700)
committerDongwon Kang <dwkang@google.com>
Thu, 3 Aug 2017 18:02:52 +0000 (18:02 +0000)
Test: passed CTS test DecoderTest#testDecodeFragmented
Bug: 64314728
Bug: 36571704
Change-Id: I71ad6aaae473b03483f8405899d3178148597bba
(cherry picked from commit ba9af7792dfed6e9b1b216aab91a97e713eec891)

media/libstagefright/MPEG4Extractor.cpp

index fe63aa0..80c2b8e 100644 (file)
@@ -3329,7 +3329,8 @@ status_t MPEG4Source::parseChunk(off64_t *offset) {
 
                 while (true) {
                     if (mDataSource->readAt(*offset, hdr, 8) < 8) {
-                        return ERROR_END_OF_STREAM;
+                        // no more box to the end of file.
+                        break;
                     }
                     chunk_size = ntohl(hdr[0]);
                     chunk_type = ntohl(hdr[1]);