diff --git a/depends/common/ffmpeg/0005-ffmpeg-windows-dxva2-check-nullptr-surface.patch b/depends/common/ffmpeg/0005-ffmpeg-windows-dxva2-check-nullptr-surface.patch new file mode 100644 index 00000000..b3e57285 --- /dev/null +++ b/depends/common/ffmpeg/0005-ffmpeg-windows-dxva2-check-nullptr-surface.patch @@ -0,0 +1,12 @@ +diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c +--- a/libavcodec/dxva2.c ++++ b/libavcodec/dxva2.c +@@ -777,7 +777,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, + #if CONFIG_D3D11VA + if (avctx->pix_fmt == AV_PIX_FMT_D3D11) + return (intptr_t)frame->data[1]; +- if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) { ++ if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && surface) { + D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; + ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) surface, &viewDesc); + return viewDesc.Texture2D.ArraySlice;