Commit c1eacd69 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent division by zero

CID #1297072, #1270654
parent 7502fa8f
......@@ -1893,6 +1893,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
}
private void doSeekTouch(int coef, float gesturesize, boolean seek) {
if (coef == 0)
coef = 1;
// No seek action if coef > 0.5 and gesturesize < 1cm
if (Math.abs(gesturesize) < 1 || !mCanSeek)
return;
......
......@@ -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, 1);
invalidate();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment