summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-04-24 15:49:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-04-24 15:49:25 +0000
commit189660fdc736b495fee20d4a83a7d8a3573e4309 (patch)
tree2975330d4f66776c2d7910a8416372791ba8ee9a /media/libstagefright/rtsp
parentaa47eb2e0560ade9e0d899e72d733bb6764973b6 (diff)
parent6cb3f224d7e2280f8834d361bba1a72682aaaad1 (diff)
downloadframeworks_av-189660fdc736b495fee20d4a83a7d8a3573e4309.zip
frameworks_av-189660fdc736b495fee20d4a83a7d8a3573e4309.tar.gz
frameworks_av-189660fdc736b495fee20d4a83a7d8a3573e4309.tar.bz2
Merge "Fix overflow of rand in ARTPConnection"
Diffstat (limited to 'media/libstagefright/rtsp')
-rw-r--r--media/libstagefright/rtsp/ARTPConnection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index 501a970..af369b5 100644
--- a/media/libstagefright/rtsp/ARTPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTPConnection.cpp
@@ -117,7 +117,8 @@ void ARTPConnection::MakePortPair(
bumpSocketBufferSize(*rtcpSocket);
- unsigned start = (rand() * 1000)/ RAND_MAX + 15550;
+ /* rand() * 1000 may overflow int type, use long long */
+ unsigned start = (unsigned)((rand()* 1000ll)/RAND_MAX) + 15550;
start &= ~1;
for (unsigned port = start; port < 65536; port += 2) {