diff options
| author | Greg Kaiser <gkaiser@google.com> | 2018-04-06 13:31:01 -0700 |
|---|---|---|
| committer | Greg Kaiser <gkaiser@google.com> | 2018-04-06 13:31:01 -0700 |
| commit | d3ac20b4257530c74878e514e948eec74c96db24 (patch) | |
| tree | ff5a09343ace35c24ade22c2fee1d0e6b9e30dfa /cmds | |
| parent | f4b7851d822339d3c796b046a3eeff07de542dc7 (diff) | |
| download | frameworks_av-d3ac20b4257530c74878e514e948eec74c96db24.tar.gz frameworks_av-d3ac20b4257530c74878e514e948eec74c96db24.tar.bz2 frameworks_av-d3ac20b4257530c74878e514e948eec74c96db24.zip | |
stagefright: Move NULL check
We switch our NULL check to before we dereference 'buffer' for
the range_length(). This allows a debug build with a bad state
to have things caught via CHECK instead of a crash.
Test: Treehugger
Change-Id: Iae3a6a9e90ec91962dc0e9bebcac075cf1d7d4c1
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/stagefright/stagefright.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 936733d3f3..bd25ceeb64 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -579,12 +579,12 @@ static void performSeekTest(const sp<MediaSource> &source) { break; } + CHECK(buffer != NULL); + if (buffer->range_length() > 0) { break; } - CHECK(buffer != NULL); - buffer->release(); buffer = NULL; } |
