TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.59k stars 3.07k forks source link

Preview seekbar thumbnail causing crash while scrubbing on some specific YouTube videos #10477

Closed TheMCNerd2017 closed 1 week ago

TheMCNerd2017 commented 1 year ago

Checklist

Affected version

0.25.2

Steps to reproduce the bug

  1. Go to this video: https://www.youtube.com/watch?v=sxl4DJXCDzA
  2. Play the video.
  3. Tap once to bring up the progress bar, and attempt to scrub forward or backwards.
  4. App crashes shortly after, sometimes not showing the error report page.

Expected behavior

NewPipe lets me go to any part of the video by scrubbing.

Actual behavior

NewPipe crashes when scrubbing to any part of the video, usually within a second.

Screenshots/Screen recordings

No response

Logs

Exception

java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
    at android.graphics.Bitmap.createBitmap(Bitmap.java:874)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:834)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.lambda$generateDataFrom$3(SeekbarPreviewThumbnailHolder.java:143)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.$r8$lambda$0elxBGHHcmMbO9kgf0vknFIh1sg(SeekbarPreviewThumbnailHolder.java:0)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder$$ExternalSyntheticLambda4.get(R8$$SyntheticClass:0)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.getBitmapAt(SeekbarPreviewThumbnailHolder.java:214)
    at org.schabi.newpipe.player.ui.VideoPlayerUi.onProgressChanged(VideoPlayerUi.java:581)
    at org.schabi.newpipe.views.FocusAwareSeekBar$NestedListener.onProgressChanged(FocusAwareSeekBar.java:130)
    at android.widget.SeekBar.onProgressRefresh(SeekBar.java:99)
    at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1578)
    at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1690)
    at android.widget.ProgressBar.setProgressInternal(ProgressBar.java:1756)
    at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:1016)
    at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:924)
    at android.view.View.dispatchTouchEvent(View.java:15050)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:500)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1912)
    at android.app.Activity.dispatchTouchEvent(Activity.java:4307)
    at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:458)
    at android.view.View.dispatchPointerEvent(View.java:15309)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6774)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6574)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6030)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6087)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6053)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6218)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6061)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6275)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6034)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6087)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6053)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6061)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6034)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9202)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9153)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9122)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9325)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
    at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
    at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:247)
    at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:9282)
    at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9416)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
    at android.view.Choreographer.doCallbacks(Choreographer.java:899)
    at android.view.Choreographer.doFrame(Choreographer.java:824)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7940)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)


Affected Android/Custom ROM version

GrapheneOS 13

Affected device model

Pixel 4 XL

Additional information

This issue also occurs on the latest nightly build of NewPipe. This is also the only video that this issue seems to occur on, as no other video triggers this specific crash when scrubbing.

TacoTheDank commented 1 month ago

Can confirm this still happens in 0.27.2 with the following video. Any attempt to drag the seekbar results in a crash.

Android 12, Samsung Galaxy S10

https://www.youtube.com/watch?v=3k8oE6pww4g

java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
    at android.graphics.Bitmap.createBitmap(Bitmap.java:865)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:825)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.lambda$generateDataFrom$3(SeekbarPreviewThumbnailHolder.java:143)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.$r8$lambda$0elxBGHHcmMbO9kgf0vknFIh1sg(SeekbarPreviewThumbnailHolder.java:0)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder$$ExternalSyntheticLambda4.get(R8$$SyntheticClass:0)
    at org.schabi.newpipe.player.seekbarpreview.SeekbarPreviewThumbnailHolder.getBitmapAt(SeekbarPreviewThumbnailHolder.java:214)
    at org.schabi.newpipe.player.ui.VideoPlayerUi.onProgressChanged(VideoPlayerUi.java:585)
    at org.schabi.newpipe.views.FocusAwareSeekBar$NestedListener.onProgressChanged(FocusAwareSeekBar.java:130)
    at android.widget.SeekBar.onProgressRefresh(SeekBar.java:99)
    at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1780)
    at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1894)
    at android.widget.ProgressBar.setProgressInternal(ProgressBar.java:1970)
    at android.widget.AbsSeekBar.setProgressInternal(AbsSeekBar.java:1635)
    at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:1241)
    at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:1119)
    at android.view.View.dispatchTouchEvent(View.java:15076)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:1015)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1962)
    at android.app.Activity.dispatchTouchEvent(Activity.java:4265)
    at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:973)
    at android.view.View.dispatchPointerEvent(View.java:15335)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7815)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7588)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6922)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7143)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7200)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10400)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10248)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10204)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10532)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
    at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
    at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
    at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:10480)
    at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:10621)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
    at android.view.Choreographer.doCallbacks(Choreographer.java:866)
    at android.view.Choreographer.doFrame(Choreographer.java:789)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8663)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)