From 5f1897538bab324f53efc6bec65487516041f2e9 Mon Sep 17 00:00:00 2001 From: Xuefei Chen Date: Mon, 7 Jan 2013 16:43:13 +0800 Subject: 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 --- media/libstagefright/rtsp/MyHandler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media/libstagefright') diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 96c76833..b2f0e5eb 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; -- cgit v1.2.3