summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorc_yongga <yongga@codeaurora.org>2016-01-05 17:28:10 +0800
committerc_yongga <yongga@codeaurora.org>2016-01-05 17:28:10 +0800
commitb2786a318d8263db0aaa1ed10b2197a9f3a78d28 (patch)
tree5c55577d7c304c4ec80fb005ea7c65b15042436a
parent37f3c8c6ab31d2fe6b220662efba6d919e50c76c (diff)
downloadandroid_packages_apps_Gallery2-b2786a318d8263db0aaa1ed10b2197a9f3a78d28.tar.gz
android_packages_apps_Gallery2-b2786a318d8263db0aaa1ed10b2197a9f3a78d28.tar.bz2
android_packages_apps_Gallery2-b2786a318d8263db0aaa1ed10b2197a9f3a78d28.zip
Gallery2: Fix IndexOutOfBoundsException when delete the images/videos
The index is out of the bounds Determine whether the index is out of the bounds Change-Id: If5a2ce1496536383e00bc86676ed80a66df44e2a CRs-Fixed: 954012
-rw-r--r--src/com/android/gallery3d/ui/TimeLineSlotView.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/ui/TimeLineSlotView.java b/src/com/android/gallery3d/ui/TimeLineSlotView.java
index fc764570a..dbb8a6a76 100644
--- a/src/com/android/gallery3d/ui/TimeLineSlotView.java
+++ b/src/com/android/gallery3d/ui/TimeLineSlotView.java
@@ -625,6 +625,10 @@ public class TimeLineSlotView extends GLView {
} if (indexEnd<0) {
indexEnd = (indexEnd * (- 1)) - 1;
}
+
+ if (indexStart > mHeightList.size() - 1) {
+ indexStart = mHeightList.size() - 1;
+ }
int startSlotIndex = mHeightList.indexOf(mHeightList.get(indexStart));
if(indexEnd> mHeightList.size()-1) {
indexEnd = mHeightList.size()-1;