Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 933b0930 authored by Wei Jia's avatar Wei Jia Committed by Michael Bestas
Browse files

MPEG4Extractor: ensure buffer size is not less than 8 for LastCommentData.

Bug: 24346430
Change-Id: I897a724e968841d9160f819d06c0ce22f6d743c4
(cherry picked from commit 5cae16bd)
(cherry picked from commit e6d904fe)
parent c4f36d3b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2254,6 +2254,12 @@ status_t MPEG4Extractor::parseMetaData(off64_t offset, size_t size) {
                    mLastCommentName.setTo((const char *)buffer + 4);
                    break;
                case FOURCC('d', 'a', 't', 'a'):
                    if (size < 8) {
                        delete[] buffer;
                        buffer = NULL;
                        ALOGE("b/24346430");
                        return ERROR_MALFORMED;
                    }
                    mLastCommentData.setTo((const char *)buffer + 8);
                    break;
            }