summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-01-12 14:35:46 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-12 14:35:46 -0800
commit20df25aae1a065d3671d8d6d9d5d81836054de7b (patch)
tree8227d7736ee78d8901b41b462ae398ec607a1679
parent3cb13098df7b0c2aaae7b18f1518b02447f3b8c0 (diff)
parent3e9eeb3b411f56d9935f9240056107816da24653 (diff)
downloadframeworks_av-20df25aae1a065d3671d8d6d9d5d81836054de7b.zip
frameworks_av-20df25aae1a065d3671d8d6d9d5d81836054de7b.tar.gz
frameworks_av-20df25aae1a065d3671d8d6d9d5d81836054de7b.tar.bz2
am 7928ca6f: Merge "Fail to parse duration instead of asserting, if the server response cannot be parsed." into honeycomb
* commit '7928ca6f87af4b70086ecf75383ba43da37da891': Fail to parse duration instead of asserting, if the server response cannot be parsed.
-rw-r--r--media/libstagefright/rtsp/ASessionDescription.cpp12
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);