Loading media/libstagefright/mpeg2ts/ESQueue.cpp +7 −2 Original line number Original line Diff line number Diff line Loading @@ -1178,7 +1178,9 @@ static ssize_t getNextChunkSize( const uint8_t *data, size_t size) { const uint8_t *data, size_t size) { static const char kStartCode[] = "\x00\x00\x01"; static const char kStartCode[] = "\x00\x00\x01"; if (size < 3) { // per ISO/IEC 14496-2 6.2.1, a chunk has a 3-byte prefix + 1-byte start code // we need at least <prefix><start><next prefix> to successfully scan if (size < 3 + 1 + 3) { return -EAGAIN; return -EAGAIN; } } Loading @@ -1186,7 +1188,7 @@ static ssize_t getNextChunkSize( return -EAGAIN; return -EAGAIN; } } size_t offset = 3; size_t offset = 4; while (offset + 2 < size) { while (offset + 2 < size) { if (!memcmp(&data[offset], kStartCode, 3)) { if (!memcmp(&data[offset], kStartCode, 3)) { return offset; return offset; Loading Loading @@ -1237,6 +1239,9 @@ sp<ABuffer> ElementaryStreamQueue::dequeueAccessUnitMPEG4Video() { state = EXPECT_VISUAL_OBJECT_START; state = EXPECT_VISUAL_OBJECT_START; } else { } else { discard = true; discard = true; offset += chunkSize; ALOGW("b/74114680, advance to next chunk"); android_errorWriteLog(0x534e4554, "74114680"); } } break; break; } } Loading Loading
media/libstagefright/mpeg2ts/ESQueue.cpp +7 −2 Original line number Original line Diff line number Diff line Loading @@ -1178,7 +1178,9 @@ static ssize_t getNextChunkSize( const uint8_t *data, size_t size) { const uint8_t *data, size_t size) { static const char kStartCode[] = "\x00\x00\x01"; static const char kStartCode[] = "\x00\x00\x01"; if (size < 3) { // per ISO/IEC 14496-2 6.2.1, a chunk has a 3-byte prefix + 1-byte start code // we need at least <prefix><start><next prefix> to successfully scan if (size < 3 + 1 + 3) { return -EAGAIN; return -EAGAIN; } } Loading @@ -1186,7 +1188,7 @@ static ssize_t getNextChunkSize( return -EAGAIN; return -EAGAIN; } } size_t offset = 3; size_t offset = 4; while (offset + 2 < size) { while (offset + 2 < size) { if (!memcmp(&data[offset], kStartCode, 3)) { if (!memcmp(&data[offset], kStartCode, 3)) { return offset; return offset; Loading Loading @@ -1237,6 +1239,9 @@ sp<ABuffer> ElementaryStreamQueue::dequeueAccessUnitMPEG4Video() { state = EXPECT_VISUAL_OBJECT_START; state = EXPECT_VISUAL_OBJECT_START; } else { } else { discard = true; discard = true; offset += chunkSize; ALOGW("b/74114680, advance to next chunk"); android_errorWriteLog(0x534e4554, "74114680"); } } break; break; } } Loading