-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch to check for nullptr on surface for dxva2 on windows
- Loading branch information
1 parent
a782ba3
commit 6599af1
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
depends/common/ffmpeg/0005-ffmpeg-windows-dxva2-check-nullptr-surface.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |