mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
libavutil/hwcontext_dxva2: Add check for possible errors from GetAdapterDisplayModeEx
This prevents a possible crash in CreateDeviceEx when using faulty response from GetAdapterDisplayModeEx and allows ffmpeg to fallback to classic d3d9. Signed-off-by: wm4 <nfxjfg@googlemail.com>
This commit is contained in:
parent
1b283c4a0d
commit
59b126f922
1 changed files with 5 additions and 1 deletions
|
|
@ -485,7 +485,11 @@ static int dxva2_device_create9ex(AVHWDeviceContext *ctx, UINT adapter)
|
|||
if (FAILED(hr))
|
||||
return AVERROR_UNKNOWN;
|
||||
|
||||
IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, &modeex, NULL);
|
||||
hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, &modeex, NULL);
|
||||
if (FAILED(hr)) {
|
||||
IDirect3D9Ex_Release(d3d9ex);
|
||||
return AVERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
d3dpp.BackBufferFormat = modeex.Format;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue