summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ARTSPConnection.cpp
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
commit78cc49b4c4b25ea51dc5f6a6878ea158056bcf32 (patch)
treeeb165d3711f0e5c0deece7cc6cad55c554b1d764 /media/libstagefright/rtsp/ARTSPConnection.cpp
parent0d55a6f35a2d37187139e50972f7b6c413b2371f (diff)
downloadframeworks_av-78cc49b4c4b25ea51dc5f6a6878ea158056bcf32.zip
frameworks_av-78cc49b4c4b25ea51dc5f6a6878ea158056bcf32.tar.gz
frameworks_av-78cc49b4c4b25ea51dc5f6a6878ea158056bcf32.tar.bz2
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
Diffstat (limited to 'media/libstagefright/rtsp/ARTSPConnection.cpp')
-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 539a888..161bd4f 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;
}