diff options
author | Andreas Huber <andih@google.com> | 2011-01-12 10:35:18 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-12 10:35:18 -0800 |
commit | 72b228f6b18763a95023fd8ba44eb7354cfd7f74 (patch) | |
tree | d17c7c9cf584a6fdcc3d7318e52cc0baa8937e23 | |
parent | 4c0104e004f30d7e48381ef8d728b2e93931611f (diff) | |
parent | e49051406baa71cb63d5754d33908ce3df201af1 (diff) | |
download | frameworks_av-72b228f6b18763a95023fd8ba44eb7354cfd7f74.zip frameworks_av-72b228f6b18763a95023fd8ba44eb7354cfd7f74.tar.gz frameworks_av-72b228f6b18763a95023fd8ba44eb7354cfd7f74.tar.bz2 |
am 7c615360: Fail to parse duration instead of asserting, if the server response cannot be parsed.
* commit '7c6153606cc963191362494c8cb5669749e84326':
Fail to parse duration instead of asserting, if the server response cannot be parsed.
-rw-r--r-- | media/libstagefright/rtsp/ASessionDescription.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp index 547fbab..77917b3 100644 --- a/media/libstagefright/rtsp/ASessionDescription.cpp +++ b/media/libstagefright/rtsp/ASessionDescription.cpp @@ -265,15 +265,17 @@ bool ASessionDescription::getDurationUs(int64_t *durationUs) const { const char *s = value.c_str() + 4; char *end; double from = strtod(s, &end); - CHECK_GT(end, s); - CHECK_EQ(*end, '-'); + + if (end == s || *end != '-') { + return false; + } s = end + 1; double to = strtod(s, &end); - CHECK_GT(end, s); - CHECK_EQ(*end, '\0'); - CHECK_GE(to, from); + if (end == s || *end != '\0' || to < from) { + return false; + } *durationUs = (int64_t)((to - from) * 1E6); |