OSDN Git Service

Fix for crash if no content in DESCRIBE response
authorXuefei Chen <xuefei.chen@sonymobile.com>
Mon, 7 Jan 2013 08:43:13 +0000 (16:43 +0800)
committerTakeshi Aimi <takeshi.aimi@sonymobile.com>
Tue, 12 Mar 2013 10:35:23 +0000 (19:35 +0900)
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

index 96c7683..b2f0e5e 100644 (file)
@@ -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;