mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Some gifs crash MPV

Open funmaker opened this issue 1 year ago • 4 comments

Important Information

Provide following Information:

  • mpv version
mpv 0.34.0-386-g284fecc0bd Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
 built on Sun Jul 31 17:13:08 CEST 2022
FFmpeg library versions:
   libavutil       57.17.100
   libavcodec      59.18.100
   libavformat     59.16.100
   libswscale      6.4.100
   libavfilter     8.24.100
   libswresample   4.3.100
FFmpeg version: n5.0.1
  • Linux Distribution and Version Arch Linux
  • Source of the mpv binary Tried: Pacman's mpv, mpv-git(AUR), built manually
  • If known which version of mpv introduced the problem Commit: 2a89da0c8548bec624f7f60f0b08d98602c7d394
  • Window Manager and version Xfwm4(Xfce 4.16)
  • GPU driver and version nvidia 515.57-9
  • Possible screenshot or video of visual glitches N/A

If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

  1. Try to open a gif in mpv mpv --no-config image.gif

Expected behavior

Gif plays

Actual behavior

Mpv crashes on assert(x1 <= img->w && y1 <= img->h);

$ mpv --no-config 050875072caa39a37b3d78598eab0122f53c13b4293704c5c5e32197795b5cec.gif
 (+) Video --vid=1 (gif 408x229 20.000fps)
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/opengl] Listing DRM devices with drmGetDevices failed! (No such file or directory)
[vo/gpu/opengl] Failed to find a usable DRM primary node!
[vo/gpu/opengl] Failed to create KMS.
Can't open bumblebee display.
[vo/gpu/vulkan/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/vulkan/context.c:883)
[vo/gpu/vulkan/libplacebo] Found no suitable device, giving up.
[vo/gpu/vulkan/libplacebo] Failed initializing vulkan device
[vo/gpu/vulkan/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/vulkan/context.c:883)
[vo/gpu-next] Can't handle VT release - signal already used
[vo/gpu-next/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu-next/opengl] Listing DRM devices with drmGetDevices failed! (No such file or directory)
[vo/gpu-next/opengl] Failed to find a usable DRM primary node!
[vo/gpu-next/opengl] Failed to create KMS.
[vo/gpu-next/vulkan/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/vulkan/context.c:883)
[vo/gpu-next/vulkan/libplacebo] Found no suitable device, giving up.
[vo/gpu-next/vulkan/libplacebo] Failed initializing vulkan device
[vo/gpu-next/vulkan/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/vulkan/context.c:883)
[vo/vdpau] Error when calling vdp_device_create_x11: 1
[vo/xv] Could not grab port 407.
[vo/xv] Could not grab port 408.
[vo/xv] Warning: this legacy VO has bad quality and performance, and will in particular result in blurry OSD and subtitles. You should fix your graphics drivers, or not force the xv VO.
[autoconvert] Converting bgra -> yuv420p
mpv: ../video/mp_image.c:548: mp_image_crop: Assertion `x1 <= img->w && y1 <= img->h' failed.
zsh: IOT instruction (core dumped)  mpv --no-config 

Log file

https://0x0.st/oeKR.txt

Backtrace

#0  0x00007f080c99036c in  () at /usr/lib/libc.so.6
#1  0x00007f080c940838 in raise () at /usr/lib/libc.so.6
#2  0x00007f080c92a535 in abort () at /usr/lib/libc.so.6
#3  0x00007f080c92a45c in  () at /usr/lib/libc.so.6
#4  0x00007f080c939366 in  () at /usr/lib/libc.so.6
#5  0x000055801d0987ff in mp_image_crop (img=img@entry=0x55801ed1d1b8, x0=x0@entry=0, y0=<optimized out>, x1=<optimized out>, y1=<optimized out>) at ../video/mp_image.c:548
#6  0x000055801d0e74f3 in wrap_buffer (st=st@entry=0x55801ed1db90, r=0x55801ed1d0d0, a_mpi=a_mpi@entry=0x55801ed10fa0) at ../video/zimg.c:263
#7  0x000055801d0e7ff7 in mp_zimg_convert (ctx=0x55801ed0fa40, dst=dst@entry=0x55801ed10fa0, src=src@entry=0x55801ed00040) at ../video/zimg.c:668
#8  0x000055801d0e6b83 in mp_sws_scale (ctx=0x55801ed0f780, dst=dst@entry=0x55801ed10fa0, src=src@entry=0x55801ed00040) at ../video/sws_utils.c:385
#9  0x000055801d021e98 in process (f=0x55801ed00740) at ../filters/f_swscale.c:119
#10 0x000055801d023319 in mp_filter_graph_run (filter=<optimized out>) at ../filters/filter.c:262
#11 0x000055801d06eaa4 in run_playloop (mpctx=mpctx@entry=0x55801ec5afc0) at ../player/playloop.c:1244
#12 0x000055801d064422 in play_current_file (mpctx=0x55801ec5afc0) at ../player/loadfile.c:1679
#13 0x000055801d065592 in mp_play_files (mpctx=mpctx@entry=0x55801ec5afc0) at ../player/loadfile.c:1865
#14 0x000055801d069851 in mpv_main (argc=<optimized out>, argv=<optimized out>) at ../player/main.c:432
#15 0x00007f080c92b290 in  () at /usr/lib/libc.so.6
#16 0x00007f080c92b34a in __libc_start_main () at /usr/lib/libc.so.6
#17 0x000055801cfd32a5 in _start () at ../sysdeps/x86_64/start.S:115

Sample files

https://0x0.st/oeKn.gif

This affects only some of gifs I try to play. The bumblebee errors are mostly likely not related as they also appear if I try to play gifs that do work. I do not try to run mpv trough optirun, primusrun or other kind of program to utilize NVIDIA optimus, in fact I have integrated card disabled right now. If I build of commits before 2a89da0c8548bec624f7f60f0b08d98602c7d394 mpv works fine.

funmaker avatar Jul 31 '22 15:07 funmaker

I believe this is a bug in zimg. What happens if you install zimg-git from the AUR?

Traneptora avatar Aug 14 '22 16:08 Traneptora

@thebombzen I've updated system and replaced zimg with zimg-git. The issue stayed the same.

funmaker avatar Aug 17 '22 17:08 funmaker

Can you post a log and/or reproduce the issue with --zimg-threads=1?

Traneptora avatar Aug 17 '22 18:08 Traneptora

Using newest mpv and zimg-git

mpv -v -v --no-config: https://0x0.st/oLr6.txt

mpv -v -v --no-config --zimg-threads=1: https://0x0.st/oLrI.txt

Both crash on:

mpv: ../video/mp_image.c:541: mp_image_crop: Assertion `x1 <= img->w && y1 <= img->h' failed.
zsh: IOT instruction (core dumped)  mpv -v -v --log-file=log.txt --no-config oeKn.gif

funmaker avatar Aug 17 '22 21:08 funmaker