From 9c937ad0d4f963eb904fb7c715f03f9a69995a4c Mon Sep 17 00:00:00 2001 From: Dan Austin Date: Fri, 16 Oct 2015 10:10:57 -0700 Subject: Benign integer overflow in PlaylistFetcher There is a benign integer overflow in the loop that finds the smallest first PTS from all streams in the current parser. The loop has been refactored to eliminate the integer overflow. Bug: 25008541 Change-Id: Ie2c0f1d360023cad960e071d810dddb1b5420470 --- media/libstagefright/httplive/PlaylistFetcher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'media') diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 023de93..23a4275 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -1634,7 +1634,8 @@ status_t PlaylistFetcher::extractAndQueueAccessUnitsFromTs(const sp &bu if (mSegmentFirstPTS < 0ll) { // get the smallest first PTS from all streams present in this parser - for (size_t i = mPacketSources.size(); i-- > 0;) { + for (size_t i = mPacketSources.size(); i > 0;) { + i--; const LiveSession::StreamType stream = mPacketSources.keyAt(i); if (stream == LiveSession::STREAMTYPE_SUBTITLES) { ALOGE("MPEG2 Transport streams do not contain subtitles."); -- cgit v1.1