[Android] Avoid dividing by 0

Geoffrey Métais git at videolan.org
Tue Feb 17 17:43:48 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 17 16:05:11 2015 +0100| [2935605308a6be06a4b8b573ee08bdf3f3ed2a8e] | committer: Geoffrey Métais

Avoid dividing by 0

CID #1270654

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=2935605308a6be06a4b8b573ee08bdf3f3ed2a8e
---

 vlc-android/src/org/videolan/vlc/widget/FlingViewGroup.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/FlingViewGroup.java b/vlc-android/src/org/videolan/vlc/widget/FlingViewGroup.java
index 243dea3..c254c5a 100644
--- a/vlc-android/src/org/videolan/vlc/widget/FlingViewGroup.java
+++ b/vlc-android/src/org/videolan/vlc/widget/FlingViewGroup.java
@@ -261,7 +261,7 @@ public class FlingViewGroup extends ViewGroup {
     public void scrollTo(int position) {
         mCurrentView = position;
         final int delta = (position * getWidth()) - getScrollX();
-        mScroller.startScroll(getScrollX(), 0, delta, 0, 0);
+        mScroller.startScroll(getScrollX(), 0, delta, 0, Math.abs(delta));
         invalidate();
     }
 



More information about the Android mailing list