summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLena Magnusson <lena.magnusson@sonyericsson.com>2012-01-20 09:39:38 +0100
committerHenrik Baard <henrik.baard@sonymobile.com>2012-11-29 15:25:48 +0100
commit8b96e5df9f085e285d23beb96fd41c3d4b8005a3 (patch)
treeba760e7d1d2eab997859b8dd371b011fae97e2d8
parent5768fa034ede834656697d3612c525595ff85ef9 (diff)
Unsolicited server responses cause RTSP streaming to crash
If the set up of the RTSP stream contains an incorrect or otherwise problematic URL, some servers will send an unsolicited server response that contains a negative number in the sequence number (CSeq) field. This negative value is not returned from the function findPendingRequest(), so the check in notifyResponseListener() will not work. Instead there will be a crash when 0 is used as the index to find a matching request/response pair that doesn’t exist. The fix is to return the received sequence number also when it is an unsolicited server-client message. Change-Id: Iedaba8a63dece7b43bce007069baefbfd10970b8
-rw-r--r--media/libstagefright/rtsp/ARTSPConnection.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp
index 539a8882..161bd4fb 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTSPConnection.cpp
@@ -830,6 +830,7 @@ status_t ARTSPConnection::findPendingRequest(
if (i < 0) {
// This is an unsolicited server->client message.
+ *index = -1;
return OK;
}