From e1a31d16dda3460a34e5dfd65c4e96e422dbdbfc Mon Sep 17 00:00:00 2001 From: Patric Frederiksen Date: Mon, 26 Sep 2011 10:51:35 +0200 Subject: Crash in android::MyHandler::parsePlayResponse This fix handles problems with several asynchronous calls within streaming. This case is when the phone has sent a request to the server and while the response is being sent back by the server the request is aborted by the user. The fix is an if case that checks if we have aborted while waiting for a response from the server. If we have aborted we should ignore the late response instead of continuing. Change-Id: I1264bb992f6abcaee1f10a89479e08b54a95e3c2 --- media/libstagefright/rtsp/MyHandler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index deee30f..96c7683 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -1091,6 +1091,10 @@ struct MyHandler : public AHandler { void parsePlayResponse(const sp &response) { mSeekable = false; + if (mTracks.size() == 0) { + ALOGV("parsePlayResponse: late packets ignored."); + return; + } ssize_t i = response->mHeaders.indexOfKey("range"); if (i < 0) { -- cgit v1.1