OSDN Git Service

Fix out of bounds array access that the monkey managed to trigger.
authorMarco Nelissen <marcone@google.com>
Tue, 2 Feb 2010 01:01:22 +0000 (17:01 -0800)
committerMarco Nelissen <marcone@google.com>
Tue, 2 Feb 2010 01:02:43 +0000 (17:02 -0800)
(http://b/2396067)

src/com/android/music/TrackBrowserActivity.java

index 39bdeed..ec24687 100644 (file)
@@ -1151,7 +1151,7 @@ public class TrackBrowserActivity extends ListActivity
             if (oldPosition == newPosition)
                 return true;
             
-            if (mNowPlaying == null || mCursorIdxs == null) {
+            if (mNowPlaying == null || mCursorIdxs == null || newPosition >= mNowPlaying.length) {
                 return false;
             }