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

Commit 1aa5592b authored by Shan An's avatar Shan An Committed by Robert Shih
Browse files

Handle Http Live Streaming native exception

Problem: Exception happens when user plays an http live streaming
source whose playlist is empty. Take baidu baike link as an example,
when user accesses
https://baikebcs.bdimg.com/others/mda-anemptyfile20170518.m3u8
and taps "play", NE happens.

Solution: Return malformed error when play an empty m3u8 file source

Bug: 123009871
Test: Launch browser to access
https://baikebcs.bdimg.com/others/mda-anemptyfile20170518.m3u8 and
then tap "play"

Change-Id: Ieaeb60f08fb24f2ca4ca554a70c5eb89b5cf6a16
parent 275f0ca6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -706,6 +706,12 @@ status_t M3UParser::parse(const void *_data, size_t size) {
        ++lineNo;
    }

    // playlist has no item, would cause exception
    if (mItems.size() == 0) {
        ALOGE("playlist has no item");
        return ERROR_MALFORMED;
    }

    // error checking of all fields that's required to appear once
    // (currently only checking "target-duration"), and
    // initialization of playlist properties (eg. mTargetDurationUs)