mpv-player/mpv — pull request #1223 by rossy2401 (2014-10-27 09:53:38+00:00)
Title: Fix DXVA2 crash due to different stride length

The new DXVA2 code crashes instantly inside memcpy on my Nvidia machine. I think it's because the D3D surface has a stride of 2048, but the mp_image only has room for an image with a stride of 1920. My old code blindly copied the image, which in retrospect was a bit silly.

This is a quick fix, but I think it should be fixed in a way that can take advantage of gpu_memcpy, perhaps by making mp_image_pool_get capable of returning mp_images with an arbitrary stride or by making copy_nv12 smart like mp_image_copy, and copying line-by-line when the src and dest have different strides.