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

Commit 057d27ac authored by Robert Shih's avatar Robert Shih Committed by Android Git Automerger
Browse files

am 4005367e: am 84e4987f: Merge "MatroskaExtractor: detect infinite loop when...

am 4005367e: am 84e4987f: Merge "MatroskaExtractor: detect infinite loop when parsing NALs" into mnc-dev

* commit '4005367e':
  MatroskaExtractor: detect infinite loop when parsing NALs
parents 81a7d0bf 4005367e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include "MatroskaExtractor.h"

#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaBuffer.h>
@@ -620,7 +621,12 @@ status_t MatroskaSource::read(
                    TRESPASS();
            }

            if (srcOffset + mNALSizeLen + NALsize > srcSize) {
            if (srcOffset + mNALSizeLen + NALsize <= srcOffset + mNALSizeLen) {
                frame->release();
                frame = NULL;

                return ERROR_MALFORMED;
            } else if (srcOffset + mNALSizeLen + NALsize > srcSize) {
                break;
            }