summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXuefei Chen <xuefei.chen@sonymobile.com>2013-01-07 16:43:13 +0800
committerTakeshi Aimi <takeshi.aimi@sonymobile.com>2013-03-12 19:35:23 +0900
commitd32b7b479fad359d7fe779a9c5b4c090cdc14b56 (patch)
tree58977eaeffaccd3630339af19d636da08580eed8
parent1a76084dd8918533b00d76fbef15888742f752df (diff)
downloadframeworks_av-d32b7b479fad359d7fe779a9c5b4c090cdc14b56.zip
frameworks_av-d32b7b479fad359d7fe779a9c5b4c090cdc14b56.tar.gz
frameworks_av-d32b7b479fad359d7fe779a9c5b4c090cdc14b56.tar.bz2
Fix for crash if no content in DESCRIBE response
If DESCRIBE response is received with status 200 but no content, MyHandler will still set content data for session description parsing. This will cause NULL Pointer crash. This fix checks whether DESCRIBE response has content before parsing session description. Change-Id: I114ae6fd54ce804e61718f62618ca9008425a433
-rw-r--r--media/libstagefright/rtsp/MyHandler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 96c7683..b2f0e5e 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -422,6 +422,9 @@ struct MyHandler : public AHandler {
if (response->mStatusCode != 200) {
result = UNKNOWN_ERROR;
+ } else if (response->mContent == NULL) {
+ result = ERROR_MALFORMED;
+ ALOGE("The response has no content.");
} else {
mSessionDesc = new ASessionDescription;