Skip to content

Commit

Permalink
Patch to check for nullptr on surface for dxva2 on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Feb 8, 2024
1 parent a782ba3 commit 6599af1
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 6599af1

Please sign in to comment.